输入n个0到100之间的整数,由小到大排序输出,每行输出8个
程序清单:
program chu1;
var i,j,k,n,x:integer;
b:array[0..100]of integer;
begin
readln(n);
for i:=0 to 100 do b[i]:=0;
for i:=1 to n do
begin
readln(x);
b[x]:= b[x]+1;
end;
k:=0;
for i:=0 to 100 do
while b[i]>0 do
begin
write( i:4 );
k:=k+1;
b[i]:=b[i]-1;
if k mod 8=0 then writeln;
end;
readln;
end.