Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
pdp31-final
(* USER: 1736 LANG: PASCAL TASK: hydrocarbons *) type ar5real=array[1..100000] of real; var a:longint; b,c:integer; i,n,m:longint; xx:ar5real; helper:array[1..100000] of longint; procedure sort(n:longint;var ar:ar5real); var i,j:longint; t:real; tt:longint; begin for i:=2 to n do for j:=n downto i do if ar[j-1]<ar[j] then begin t:=ar[j-1];ar[j-1]:=ar[j];ar[j]:=t; tt:=helper[j-1];helper[j-1]:=helper[j];helper[j]:=tt; end; end; begin readln(n); for i:=1 to n do helper[i]:=i; m:=0; for i:=1 to n do begin readln(a,b,c); xx[i]:=a-a*b/3000-a*c/40; if xx[i]>0 then m:=m+1; end; writeln(m); if n>1 then sort(n,xx); if m>0 then for i:=1 to m do writeln(xx[i]:22:11,helper[i]:11); end.
run
|
edit
|
history
|
help
0
eliminar elementos de un arreglo
practica 7 ejercicio B2
Banking
uuu
Zad 3 b
test27
Луноход-3
SudokuSolver
checks if a number is exceptional
CON YÊU MẸ