umm我开了long long了啊为什么还是错了。

P1634 禽兽的传染病

你就不能像这样 ``` #include<cstdio> int main() {    printd("hello world");    return 0; } ``` 把代码写好看一点么? 格式: **```** 贴代码 **```**
by 密期望 @ 2018-02-16 18:45:05


@[密期望](/space/show?uid=81705) sorry,printf写错了
by 密期望 @ 2018-02-16 18:45:38


@[密期望](/space/show?uid=81705) 它复制粘贴就这样了.. // luogu-judger-enable-o2 #include<iostream> #include<algorithm> #include<cstdio> using namespace std; int quick_pow(int a,int r) { long long ans; while(r) { if(r&1)ans*=a; a*=a; r>>=1; }return ans; } int main() { int x,n; cin>>x>>n; cout<<quick_pow(x+1,n); return 0; }
by 阿蒙 @ 2018-02-25 13:37:16


```cpp // luogu-judger-enable-o2 #include<iostream> #include<algorithm> #include<cstdio> using namespace std; int quick_pow(int a,int r) { long long ans; while(r) { if(r&1)ans*=a; a*=a; r>>=1; }return ans; } int main() { int x,n; cin>>x>>n; cout<<quick_pow(x+1,n); return 0; } ```@[密期望](/space/show?uid=81705)
by 阿蒙 @ 2018-02-25 13:38:03


``` #include<iostream> #include<algorithm> #include<cstdio> using namespace std; long long quick_pow (long long a,int r) //a要重复*=a,所以也要开long long { long long ans=1;//初始化 while(r) { if(r&1)ans*=a; a*=a; r>>=1; }return ans; } int main() { int x,n; cin>>x>>n; cout<<quick_pow(x+1,n); return 0; } ```
by 密期望 @ 2018-02-28 18:28:52


@[叶淮秋](/space/show?uid=55067) 你要选择插入代码就不会有这种情况了
by xieyihang @ 2018-06-20 21:39:50


|