96 条题解
-
-112234洪子昊 (12234洪子昊) LV 8 @ 2021-12-26 20:23:39
#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:23:37@
#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:23:35@
#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:52@
#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:50@
#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:48@
#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:46@
#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:44@
#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:42@
#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:40@
#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:39@
#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:37@
#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:35@
#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: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";
}V -
-12021-12-26 14:01:26@
#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-11-28 11:09:10@
#include <iostream> #include<stdio.h> using namespace std; int main() { int a,b; scanf("%d",&a); if (a ==1); while(a !=1) { if (a%2 == 1) { b = a*3+1; printf ("%d*3+1=%d\n",a,b); a = b; } if (a%2 != 1) { b = a/2; printf ("%d/2=%d\n",a,b); a = b; } if (a ==1) break; } printf ("End\n"); return 0; }
信息
- ID
- 1748
- 难度
- 2
- 分类
- (无)
- 标签
- 递交数
- 80
- 已通过
- 44
- 通过率
- 55%
- 被复制
- 2
- 上传者