96 条题解
-
112234洪子昊 (12234洪子昊) LV 8 @ 2021-12-26 20:22:56
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
12021-12-26 20:22:54@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02022-08-25 12:50:58@
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; while(n!=1) { if(n%2==0) { cout<<n<<"/"<<2<<"="<<n/2<<endl; n/=2; } else { cout<<n<<"*"<<3<<"+"<<1<<"="<<n*3+1<<endl; n=3*n+1; } } cout<<"End"; return 0; }
-
02021-12-26 20:23:34@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:32@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:30@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:28@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:25@
v
-
02021-12-26 20:23:23@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:22@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:20@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:18@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:16@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:14@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:12@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:09@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:07@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:04@
v
-
02021-12-26 20:23:03@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
} -
02021-12-26 20:23:01@
#include<iostream>
using namespace std;
int main()
{
int N;
cin>>N;
if(N==1)
cout<<"End";
else
while(N>1)
{
if(N%2==0)
{
cout<<N<<'/'<<2<<'='<<N/2<<endl;
N=N/2;
}
else
if(N%2!=0)
{
cout<<N<<'*'<<3<<'+'<<1<<'='<<N*3+1<<endl;
N=N*3+1;
}
}
cout<<"End";
}
信息
- ID
- 1748
- 难度
- 2
- 分类
- (无)
- 标签
- 递交数
- 80
- 已通过
- 44
- 通过率
- 55%
- 被复制
- 2
- 上传者