1 solutions
-
0
Pascal :
var s,i,j,n,h,t:integer; a,b:array[1..100] of integer; begin readln(n); for i:=1 to n do begin read(a[i]); b[i]:=i end; for i:=1 to n do for j:= i+1 to n do if a[i]<a[j] then begin t:=a[i]; a[i]:=a[j]; a[j]:=t; t:=b[i]; b[i]:=b[j]; b[j]:=t; end; for i:= 1 to 5 do writeln(b[i],' ',a[i]); end.
- 1
Information
- ID
- 18550
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- (None)
- # Submissions
- 0
- Accepted
- 0
- Uploaded By