hhn001 @ 2021-12-10 21:23:04
为啥第4个测试点WA了
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n;
if(n==1) cout<<"End";
for(;n!=1;){
if(n%2==1){
m=n;
n*=3;
n++;
printf("%d*3+1=%d\n",m,n);
}else{
m=n;
n/=2;
printf("%d/2=%d\n",m,n);
}
}
cout<<"End";
return 0;
}
by hhn001 @ 2021-12-10 21:24:12
显示: 错误答案 第 1 行太长。
by InterN_NOT_FOUND @ 2021-12-10 21:30:47
@hhn001 你这个如果输入为1会输出两次End
by hhn001 @ 2021-12-10 21:32:28
谢谢大佬