zhangsuolin @ 2024-05-03 15:14:24
下面两个WA了,不知道为啥```
using namespace std;
int main() { long long a; //没怀疑过他 cin>>a; while(a!=1) { if(a%2==0) { //cout<<a<<"/2="<<a/2<<endl; TLE printf("%d/2=%d\n",a,a/2); a/=2; } else { //cout<<a<<"3+1="<<a3+1<<endl; TLE printf("%d3+1=%d\n",a,a3+1); a=a*3+1; } } //cout<<"End"; TLE printf("End"); return 0; }
by wenjunyi @ 2024-05-04 17:22:43
@zhangsuolin 看不清啊
by wenjunyi @ 2024-05-04 17:34:13
@zhangsuolin 要把printf里所有的%d改成%lld因为a是long long类型的
by wenjunyi @ 2024-05-04 17:34:45
求关注
by zhangsuolin @ 2024-05-04 17:50:00
xiexie,解决了,关注了
by zhangsuolin @ 2024-05-04 17:50:50
@wenjunyi 已关