Алгоритмы и программы. Афанасьева Т. В - 184 стр.

UptoLike

Составители: 

184
Пример 10.5.
program mas3;
uses crt;
const a:array[1..5,1..5] of integer=((0,1,2,3,4),
(5,6,7,8,9),
(0,1,2,3,4),
(5,6,7,8,9),
(0,1,2,3,4));
var
i,j:byte;
k:integer;
begin
textbackground(0);
clrscr;
textcolor(5);
window(5,5,21,12);
textbackground(3);
clrscr;
writeln('Дана матрица:');
for i:=1 to 5 do
begin
for j:=1 to 5 do
begin
if (i+j>6) and (a[i,j] mod 2=0) AND (A[i,j]<>0)
THEN textcolor(4)
else textcolor(0);
write(a[i,j]:3);
end;
writeln;
end;
textcolor(0);
writeln;
window(26,10,78,13);
textbackground(13);
clrscr;
writeln(' Задание:найти сумму четных
элементов,расположенных');
writeln(' ниже побочной диагонали.');
k:=0;