bangke @ 2024-08-01 15:23:15
#include<bits/stdc++.h>
using namespace std;
long long n;
int main(){
scanf("%d",&n);
while(n!=1){
if(n&1){printf("%d*3+1=%d\n",n,n*3+1);n*=3;n+=1;}
else{printf("%d/2=%d\n",n,n/2);n/=2;}
}
printf("End\n");
return 0;
}
by mayike @ 2024-08-01 15:25:13
@bangke long long
类型是 %lld
而不是 %d
by bangke @ 2024-08-01 15:28:07
@mayike 谢谢大佬,请问我是什么牌子的煞笔:(
by mayike @ 2024-08-01 15:29:24
:)
by czf546 @ 2024-08-01 15:30:42
qp