Чёрновой вариант:
Код | program Project2;
{$APPTYPE CONSOLE}
var a:array[1..10] of integer; min,max,i,j:integer; srednee:real;
begin { TODO -oUser -cConsole Main : Insert code here } writeln('====Nabor znacheniy===='); for i:=1 to 10 do begin writeln; write('a[',i,']='); readln(a[i]); if a[i]=0 then break; end;
min:=a[1]; for j:=1 to i-1 do if min>a[j] then min:=a[j]; writeln('minimum=',min);
max:=a[1]; for j:=1 to i-1 do if max<a[j] then max:=a[j]; writeln('maximum=',max);
srednee:=(max+min)/2; writeln('Srednee=',srednee:4:4);
readln; end.
|
|