Const
n=5;
var
m:array[1..n] of byte;
function Itog():real;
var
i,max,min,s:byte;
begin
s:=m[1]; max:=s; min:=s;
for i:=2 to n do begin
s:=s+m[i];
if max<m[i] then max:=m[i]
else
if min>m[i] then min:=m[i]
end;
s:=s-max-min;
Itog:=s/(n-2)
end;
var
i:byte;
begin
Writeln('Введите экспертные оценки');
for i:=1 to n do Read(m[i]);
Writeln('Итоговый балл равен ',Itog:4:2)
end.
<em><u>Тестовое решение:</u></em>
Введите экспертные оценки
4 4 5 3 5
Итоговый балл равен 4.33
#include <iostream>
using namespace std;
int main()
{
int x,y;
float p;
float a, b;
cin >> x;
cin >> y;
cin >> p;
a = x + (p/100)*x;
<span>b = (y + (p/100)*y)/100;
</span>cout << a+b;
return 0;
}
Var a: array [1..100] of integer;
n, i, j: integer;
fout: text;
begin
assign(fout, 'output.txt');
rewrite(fout);
n := 10; //n - длина массива
for i := 1 to n do
a[i] := random(100);
for i := 1 to n do
write(fout, a[i], ' ');
writeln(fout);
j := 1;
for i := 2 to n do
if a[i] > a[j] then
j := i;
writeln(fout, 'max = ', a[j], ' max_ind = ', j);
j := 1;
for i := 2 to n do
if a[i] < a[j] then
j := i;
writeln(fout, 'min = ', a[j], ' min_ind = ', j);
close(fout);
<span>end.</span>
В D1 пиши: $A1+B$1+C$1 в низ по аналогии
//PascalABC.Net 3.0, сборка 1052
type
Balls = class
r:real;
constructor (rr:real);
begin r:=rr end;
function VB:real;
begin
VB:=4*Pi*r*sqr(r)/3
end;
end;
var
b:Balls;
R:real;
begin
Write('Радиус шара= '); Read(R);
b:=new Balls(R);
Writeln('Объем шара равен ',b.VB:0:3)
end.
<em><u>Тестовое решение:</u></em>
Радиус шара= 25
Объем шара равен 65449.847