Run ID:68495

提交时间:2024-03-23 15:46:36

#include<iostream> using namespace std; int main(){ long long n; cin>>n; while(n != 1){ if(n % 2 == 0){ n = n/2; }else{ n = (3*n + 1)/2; } cout<<n<<" "; } }