主题:tju1127
program tju1127;
var a:array[1..100] of integer;
b,c:integer;
begin
while not seekeof(input) do
begin
fillchar(a,sizeof(a),0);
readln(b);
for c:=1 to b do
readln(a[c]);
for c:=1 to b do
begin
write(a[c],' ');
while a[c]<>1 do
begin
if odd(a[c])
then a[c]:=a[c]*3+1
else a[c]:=a[c] div 2;
write(a[c],' ');
end;
writeln;
end;
end;
end.
非法数字格式~~~~~~~~~~~~~~
var a:array[1..100] of integer;
b,c:integer;
begin
while not seekeof(input) do
begin
fillchar(a,sizeof(a),0);
readln(b);
for c:=1 to b do
readln(a[c]);
for c:=1 to b do
begin
write(a[c],' ');
while a[c]<>1 do
begin
if odd(a[c])
then a[c]:=a[c]*3+1
else a[c]:=a[c] div 2;
write(a[c],' ');
end;
writeln;
end;
end;
end.
非法数字格式~~~~~~~~~~~~~~