测试点5 WA 了; 每日下载次数无了,蒟蒻求助!!!
#include<bits/stdc++.h>
using namespace std;
int n,i=1,b[102],m;
int main(){
//freopen("b.in","r",stdin);
//freopen("b.out","w",stdout);
cin>>n;
m=n;
while(n!=1){
if(n%2==0){
n=n/2;
b[i]=n;
i++;
}
else{
n=n*3+1;
b[i]=n;
i++;
}
}
for(int j=i-1;j>=1;j--){
cout<<b[j]<<' ';
}
cout<<m;
//fclose(stdin);fclose(stdout);
return 0;
}