Program pr1;
Var A:array [1..10] of integer;
i,k:integer;
begin
for i:=1 to 10 do
read (A[i]);
k:=0;
for i:=1 to 10 do
if A[i] mod 2=0 then
k:=k+1;
writeln;
writeln (k);
end.
наверное так, но лучше проверь в паскале
Метеорит чёрного цвета упал в лесной массив.
Const
n = 8;
var
i, j, umax, lmax: integer;
a: array[1..n, 1..n] of integer;
begin
Randomize;
writeln('Исходный массив');
for i := 1 to n do
begin
for j := 1 to n do
begin
a[i, j] := Random(40) - 20;
write(a[i, j]:4)
end;
writeln;
end;
umax := -100;
for i := 1 to n do
for j := i to n do
if umax < a[i, j] then umax := a[i, j];
lmax := -100;
for i := 1 to n do
for j := 1 to i do
if lmax < a[i, j] then lmax := a[i, j];
writeln('Разность максимумов равна ', umax - lmax)
end.
Тестовое решение:
Исходный массив
-5 18 -13 1 -16 5 0 -13
4 -18 -17 -14 2 10 -2 -15
-15 -8 -6 -16 -10 -12 -18 -17
-18 6 11 -5 4 -6 -1 1
10 14 3 -7 2 11 10 -1
6 -2 -20 1 4 9 13 -4
-9 -7 4 -6 -12 3 1 -14
15 -16 -1 -3 13 -15 3 -10
Разность максимумов равна 3
описание - это собственно его разработка, написание кода, составление формул и т.п.
обращение - это просто сказать - а ну ка выполнись с такими то параметрами, и оно там выполняется, а мы может и знать не знаем чего оно там конкретно делает.
#include <iostream>
using namespace std;
int main()
{
double a,b,c,d;
cout << "Enter 1st-triangle catheti here: " << endl;
cin >> a >> b;
cout << "Enter 2nd-triangle catheti here: " << endl;
cin >> c >> d;
bool podobie = ((a/c == b/d) || (a/d == b/c));
cout << boolalpha;
cout << podobie;
cin.get();
cin.get();
return 0;
}<span>
</span>