hi, i am newbie..
I've just in this forum and also just a few days joining online judges, and the only language i can is pascal..
anybody plis can help me solving the 100 problem using pascal?
i just don't understand c, c++, and i don't even understand the problem..
am i wrong defining the problem in this way:
look for the maximum cycle length between two integer from the input..
maximum cycle length: number printed as output from the algorithm given as the problem
i tried this code:
uses crt;
var a:integer;
begin
clrscr;
write('Input: ');readln(a);
if a=1 then exit;
write(a, ' ');
while a>1 do begin
if a mod 2 = 1 then begin a:=a*3+1;write(a, ' ');end;
if a mod 2 = 0 then begin a:=a div 2;write(a, ' ');end;
end;
readln;
end.
i just wrote the algorithm, input 22, and the output is the same as in the problem, now i just need to write codes to count it, and then apply it to the input (numbers between 2 integer) isn't it?
i am really confused and not knowing what to do know..
anybody can help me by subscribing the code maybe?