40分求助

P1634 禽兽的传染病

int s=sum*x; 改为 long long s=sum*x;
by 敢问高姓大名 @ 2024-07-29 14:02:26


``` #include<iostream> using namespace std; int main(){ long long x,n,tot=1; cin>>x>>n; for(int i=0;i<n;i++){ tot=tot+tot*x; } cout<<tot; return 0; } ``` # 求关
by gyx20141112 @ 2024-08-15 15:53:54


```cpp #include<bits/stdc++.h>  using namespace std; int main(){ long long x,n,s=1; cin>>x>>n; while(n--)s=s+s*x; cout<<s<<endl; return 0; } ```
by cxt1 @ 2024-08-20 19:36:11


|