#include<stdio.h>
int main()
{
int n,count;
scanf("%d", &n);
while(n != 1){
if(n%2 == 0){
n = n/2;
}
else{
n = (3*n + 1)/2;
}
count++;
}
printf("%d",count);
return 0;
}
#include<stdio.h>
int main(){
int num,sec=1;
scanf("%d\n",&num);
while(num--){
long long a,b,c;
scanf("%lld%lld%lld",&a,&b,&c);
if(a+b>c){
printf("Case #%d: true\n",sec++);
}else{
printf("Case #%d: false\n",sec++);
}
}
return 0;
}
原文:https://www.cnblogs.com/rrrrraulista/p/12341715.html