программка)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
program for_ivan;
var
a:array[1..4,1..4] of integer;
i,j,sum,t,y,k:integer;
begin
randomize;
for i:=1 to 4 do
begin
for j:=1 to 4 do
begin
a[i,j]:=random(10);
write(' ',a[i,j]);
end;
writeln;
end;
for i:=1 to 4 do
begin
for j:=1 to 4 do
begin
if a[i,j]<>-1 then
begin
t:=a[i,j];
for k:=i to 4 do
begin
for y:=1 to 4 do
begin
if a[k,y]=t then
begin
sum:=sum+1;
a[k,y]:=-1;
end;
end;
end;
writeln('kolichestvo ',t,' - ',sum);
sum:=0;
end;
end;
end;
readln;
end.