program P1;
uses
crt;
var
A : array[1..3] of array [1..4] of longint;
i,j : integer;
begin
clrscr;
randomize;
writeln('Massiv : ');
for i := 1 to 3 do
begin
writeln('');
for j := 1 to 4 do
begin
A[i][j] := random(15)+random(5)-random(5);
write(A[i][j]:2,' ');
end;
end;
for i := 1 to 3 do
for j := 1 to 4 do
begin
if A[i][j] > 10 then
A[i][j] := i - j;
if (A[i][j] >= -5) and (A[i][j] <= 5) then
A[i][j] := sqr(i);
end;
writeln('');
writeln('');
writeln('Itogoviy massiv : ');
for i := 1 to 3 do
begin
writeln('');
for j := 1 to 4 do
begin
write(A[i][j]:2,' ');
end;
end;
readln;
readln;
end.
Написано на языке C++.
Я проверил свой код. Он работает правильно!
#include <iostream>
using namespace std;
int main()
{
float a, b, c, y, use1, use2, use3, uset;
cout << "Введите значение a: " << endl;
cin >> a;
cout << "Введите значение b: " << endl;
cin >> b;
cout << "Введите значение c: " << endl;
cin >> c;
use1 = 5 * a * b * c;
use2 = b *= b;
use3 = c *= c;
uset = use2 / use3;
y = use1 + uset + b;
cout << "Результат: " << y << endl;
return 0;
}