begin Randomize; Writeln('Исходный массив'); min:=32767; for i := 1 to n do begin a[i] := Random(99)+1; Write(a[i]:3); if ((a[i] mod 2)<>0) and (min>a[i]) then min:=a[i] end; Writeln; Writeln('Минимальный нечетный элемент равен ',min) end.
Я уже сделал на паскале Ладно пусть будет... var a: array[1..10] of integer; i,j,k,sum,d:integer; h:real; begin d:=0; for i:=1 to 10 do for j:=1 to 5 do begin readln(a[j]); if j=5 then begin sum:=0; for k:=1 to 5 do sum:=sum+a[j]; h:=sum/5; writeln(h:0:0); // Если нужно точное значение, поменяйте последний 0 на 2 if h<7 then inc(d) end; end; write(d, ' учеников - имеют средний ниже среднего'); end.
Console.WriteLine("Введіть a: ");
int a = Console.ReadLine();
Console.WriteLine("Введіть b: ");
int b = Console.ReadLine();
Console.WriteLine("Введіть c: ");
int c = Console.ReadLine();
Console.WriteLine("Введіть x: ");
int x = Console.ReadLine();
Console.WriteLine("Введіть y: ");
int y = Console.ReadLine();
if(x>y){
int x = temp;
x = y;
y = temp;
}
int sum = 0;
if(a>x && a<y){
sum = sum+a;
}
if(b>x && b<y){
sum = sum+b;
}
if(c>x && c<y){
sum = sum+c;
}
Console.WriteLine("Сума");
Console.WriteLine(sum);