|
|
back to boardPLEASE HELP!!! My prog should be correct but WA#6... What's wrong with this prog? var a:array[1..2000] of integer; i,j,n,max,min:integer; begin readln(n); for i:=1 to n do read(a[i]); for i:=1 to n do begin min:=1; max:=n; for j:=1 to n do begin if (j>i) and (a[j]<a[i]) then inc(min); if (j<i) and (a[j]>a[i]) then dec(max); end; writeln(min,' ',max); end; end. |
|
|