Program n1; const n=15; var a: array[1..n] of integer; pc,pn,nmin,nmax,max,min,i: integer; begin randomize; pc:=1; pn:=1; write('массив: '); for i:=1 to n do begin a[i]:=random(100); write(a[i],' '); end; writeln; for i:=1 to n do if i mod 2=0 then pc:=pc*a[i] else pn:=pn*a[i]; if pc>pn then begin max:=a[1]; for i:=2 to n do if a[i]>max then begin max:=a[i]; nmax:=i; end; writeln('номер максимального элемента: ',nmax); end else begin min:=a[i]; for i:=2 to n do if a[i]<min then begin min:=a[i]; nmin:=i; end; write('номер минимального элемента: ',nmin); end; end.
Using System;
namespace chislaabc
{
class Program
{
static void Main(string[] args)
{
int a, b, c;
Console.WriteLine(“Введите число a”);
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(“Введите число b”);
b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(“Введите число c”);
c = Convert.ToInt32(Console.ReadLine());
if (a == b || a == c || b == c)
{
Console.WriteLine(«Есть хотя бы одна противоположная пара»);
}
else
{
Console.WriteLine(«Противоположных чисел нет»);
}
Console.ReadKey();
}
}
}