do...while
2023-12-30 13:11:07
发布于:上海
118阅读
0回复
0点赞
#include<iostream>
using namespace std;
int n;
int main(){
cin >> n;
do{
if (n%2){
cout << n << "3+1=";
n=n3+1;
cout << n << endl;
}
else{
cout << n << "/2=";
n/=2;
cout << n << endl;
}
}
while (n>1);
cout << "End" << endl;
return 0;
}
这里空空如也
有帮助,赞一个