Search found 1 match

by krik
Tue Jun 07, 2005 6:36 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318271

WA in problem 100 [pascal]

I trying with longint too :/
I have WA , and i can't to fix it :(
Please help.

function nx(liczba:word):word;
var licznik:word;
begin
licznik:=1;
while liczba>1 do
begin
inc(licznik);
if liczba mod 2=0 then
liczba := liczba div 2 else
liczba := liczba+liczba+liczba+1;
end;
nx:=licznik;
end ...

Go to advanced search