delete pics to save space
This commit is contained in:
22
history_source/信息学奥赛一本通/1.4.2.2.cpp
Normal file
22
history_source/信息学奥赛一本通/1.4.2.2.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include<cstdio>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
long long n;
|
||||
scanf("%lld",&n);
|
||||
while(n>1)
|
||||
{
|
||||
if(n&1)
|
||||
{
|
||||
printf("%lld*3+1=%lld\n",n,n*3+1);
|
||||
n=n*3+1;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%lld/2=%lld\n",n,n/2);
|
||||
n=n/2;
|
||||
}
|
||||
}
|
||||
printf("End\n");
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user