96 条题解
-
-112234洪子昊 (12234洪子昊) LV 8 @ 2021-12-26 20:25:08
k
-
-12021-12-26 20:25:06@
k
-
-12021-12-26 20:25:05@
k
-
-12021-12-26 20:25:04@
l
-
-12021-12-26 20:25:02@
k
-
-12021-12-26 20:25:00@
k
-
-12021-12-26 20:24:57@
k
-
-12021-12-26 20:24:56@
k
-
-12021-12-26 20:24:55@
k
-
-12021-12-26 20:24:53@
k
-
-12021-12-26 20:24:52@
k
-
-12021-12-26 20:24:50@
l
-
-12021-12-26 20:24:47@
l
-
-12021-12-26 20:24:44@
l
-
-12021-12-26 20:24:43@
l
-
-12021-12-26 20:24:42@
k
-
-12021-12-26 20:24: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";
} -
-12021-12-26 20:24:26@
v
-
-12021-12-26 20:24:24@
#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:24:21@
#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
- 上传者