Паскаль
1)Program abc; Uses crt;
var S:integer; a:array [1..10,1..10];
begin
For i:=1 to 10 do
For j:=1 to 10 do
read(a[i,j]);
writeln;
S:=0;
if i=j then S:=S+a[i,j];
write('Сумма равна',S)
end.
2)
Program abc; Uses crt;
var min:integer; a:array [1..10,1..10];
min:=a[1,1];
if a[i,j]<min then min:=a[i,j];
writeln('Минимальный элемент равен',min);
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Паскаль
1)Program abc; Uses crt;
var S:integer; a:array [1..10,1..10];
begin
For i:=1 to 10 do
For j:=1 to 10 do
read(a[i,j]);
writeln;
begin
S:=0;
For i:=1 to 10 do
For j:=1 to 10 do
if i=j then S:=S+a[i,j];
write('Сумма равна',S)
end.
2)
Program abc; Uses crt;
var min:integer; a:array [1..10,1..10];
begin
For i:=1 to 10 do
For j:=1 to 10 do
read(a[i,j]);
writeln;
min:=a[1,1];
For i:=1 to 10 do
For j:=1 to 10 do
if a[i,j]<min then min:=a[i,j];
writeln('Минимальный элемент равен',min);
end.