Код на C++:
#include <iostream>
#include <ctime>
#include <cmath>
using namespace std;
int main()
{
setlocale(LC_ALL, "rus");
srand(time(NULL));
short res = 0;
for(int i = 0; i < 3; i++)
{
res += (rand() % 6) + 1;
}
cout << pow(res, 2) << endl;
return 0;
};
Объяснение:
В переменную res мы прибавляем случайное число от 1 до 6 (случайное значение вычисляется при функции rand()). Потом мы число возводим в квадрат и выводим его
mas : array [1..5] of longint;
sum : longint;
i: byte;
begin
for i:=1 to 5 do
begin
read (mas[i]);
if (mas[i] mod 4 = 0) and (mas[i] mod 10 = 6) then sum:=sum+mas[i];
end;
writeln (sum);
end.