Žiaci a známka - Zadanie 10

program zadanie10; uses crt; var m:array [1..100] of string; z,p:array [1..100] of integer; i,n:integer; k:string; priem:real; BEGIN clrscr; writeln ('Zadaj kolko žiakov zadáš'); readln (n); for i:=1 to n do        BEGIN writeln ('Zadaj meno '); readln (m[i]); writeln ('Zadaj počet percent'); readln (p[i]); writeln; case p[i] of        0..59: write ('Známka je 5'); 60..69: write ('Známka je 4'); 70..79: write ('Známka je 3'); 80..89: write ('Známka je 2'); 90..100: write ('Známka je 1'); end; case p[i] of        0..59: z[i]:=5; 60..69:z[i]:=4; 70..79: z[i]:=3; 80..89: z[i]:=2; 90..100:z[i]:=1; end; priem:=priem+z[i]; END; clrscr; priem:=priem/n; for i:=1 to n do begin write (m[i]); write (' ',p[i],'%  '); writeln ('  =  ',z[i]); end; writeln ('Priemerna znamka: ',priem:2:2); readln; END.