|
|
back to boardwhat is my problem look my program you can give tests Posted by zzzlll 5 Jan 2007 13:55 var a1,a2:array[1..5000] of longint; n,k,i,gec,gec2:integer; begin readln(n); for k:=1 to n do readln(a1[k],a2[k]); for k:=1 to n do begin for i:=k+1 to n do begin if a2[k]<a2[i] then begin gec:=a1[k]; a1[k]:=a1[i]; a1[i]:=gec; gec2:=a2[k]; a2[k]:=a2[i]; a2[i]:=gec2; end; end; end; for k:=1 to n do writeln(a1[k],' ',a2[k]); end. |
|
|