1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25




#include <stdio.h>

int main()
{
int n;

scanf("%d", &n);
while(n != 1)
{
if(n%2 == 0)
{
printf("%d/2", n);
n = n/2;
}
else
{
printf("%d*3+1", n);
n = n*3 + 1;
}
printf("=%d\n", n);
}
printf("End\n");

return 0;
}