Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  dfqwef
Language: PASCAL
Code:
var
    n, i: word;
 
begin
    for i:=20 to 30 do begin
        n := i;
        while n <> 1 do begin
            if (n mod 2) = 0 then
                n := n div 2
            else
                n := (3*n + 1) div 2;
            write(' |',n,'|');
        end;
        writeln; writeln;
 
    end;
 
readln;
end.
Comments: