96 条题解
-
012234洪子昊 (12234洪子昊) LV 8 @ 2021-12-26 20:22:59
#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";
} -
-12022-01-25 15:41:51@
#include <bits/stdc++.h>
using namespace std;int main(){
long long x;
cin>>x;
while(x!=1)
{
if(x%2!=0)
{
cout<<x<<"*3+1="<<x*3+1<<endl;
x=x*3+1;
}
else
{
cout<<x<<"/2="<<x/2<<endl;
x/=2;
}
}
cout<<"End";
return 0;
} -
-12022-01-25 15:41:27@
#include <bits/stdc++.h>
using namespace std;int main(){
long long x;
cin>>x;
while(x!=1)
{
if(x%2!=0)
{
cout<<x<<"*3+1="<<x*3+1<<endl;
x=x*3+1;
}
else
{
cout<<x<<"/2="<<x/2<<endl;
x/=2;
}
}
cout<<"End";
return 0;
} -
-12021-12-26 20:25:32@
k
-
-12021-12-26 20:25:31@
k
-
-12021-12-26 20:25:30@
k
-
-12021-12-26 20:25:28@
k
-
-12021-12-26 20:25:25@
k
-
-12021-12-26 20:25:24@
k
-
-12021-12-26 20:25:22@
k
-
-12021-12-26 20:25:21@
k
-
-12021-12-26 20:25:20@
k
-
-12021-12-26 20:25:19@
k
-
-12021-12-26 20:25:17@
k
-
-12021-12-26 20:25:16@
k
-
-12021-12-26 20:25:15@
k
-
-12021-12-26 20:25:13@
k
-
-12021-12-26 20:25:12@
k
-
-12021-12-26 20:25:11@
k
-
-12021-12-26 20:25:09@
k
信息
- ID
- 1748
- 难度
- 2
- 分类
- (无)
- 标签
- 递交数
- 80
- 已通过
- 44
- 通过率
- 55%
- 被复制
- 2
- 上传者