//Если произведение находится в промежутке не [-150 ; 200] , а в промежутке (-150 ; 200) , то замените >= и <= на > и < соответственно
using System;
namespace ConsoleApp11
{
class Program
{
static void Main(string[] args)
{
const int size = 3;
int[] numbers = new int[size];
for (int i = 0; i < size; i++)
{
Console.Write("Введите " + (i + 1) + " число: ");
numbers[i] = int.Parse(Console.ReadLine());
}
if (Sum(numbers) >= 0 && Multiplication(numbers) >= -150 && Multiplication(numbers) <= 200)
{
Console.WriteLine("");
int counter = 0;
while(counter < 3)
{
Console.WriteLine("Ура!");
counter++;
}
}
Console.ReadKey();
}
static int Sum(int[] arr)
{
int sum = 0;
for (int i = 0; i < arr.Length; i++)
sum += arr[i];
return sum;
}
static int Multiplication(int[] arr)
{
int multiplication = 1;
for (int i = 0; i < arr.Length; i++)
multiplication *= arr[i];
return multiplication;
}
}
}
//PascalABC.NET
//Версия 3.4.2
begin
range(1,ReadInteger('n=')).Where(x->x.IsEven).Println;
end.
10110
1011
---------
100001
22+11⇒33
Program Nuli;
uses Crt;
const M=8;
type Mat = array [1..M,1..M] of integer;
var i,j: integer;
A: Mat;
begin
ClrScr;
WriteLn ('Old Massiv:');
for i:=1 to M do
begin
for j:=1 to M do
begin
A[i,j]:=10+random(90);
Write(A[i,j]:4);
end;
WriteLn;
end;
WriteLn;
WriteLn ('New Massiv:');
for i:=1 to M do
for j:=1 to M do
if j<=(M-i) then A[i,j]:=0;
for i:=1 to M do
begin
for j:=1 to M do
begin
Write(A[i,j]:4);
end;
WriteLn;
end;
WriteLn;
ReadLn;
end.