Collatz Problem by pooq

var a,b:comp;begin read(a);repeat writeln(a);b:=a mod 2;a:=a div 2*(1-b)+b*(3*a+1)until a<2;write(a)end.

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page