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
var a: array[0..100,0..100] of integer;
n, m, i, j, max, col: integer;
begin
read(n);
read(m);
for i: =0 to n-1 do
for j: =0 to m-1 do
read(a[i,j]);
if max< a[i,j] then max: =a[i,j];
end;
if max=a[i,j] then begin inc(col); break; end;
writeln(col);
if max=a[i,j] then begin write(i, ' '); break; end;
end.
var
a, n: longint;
text: textfile;
function myMod(num, power, divider: longint): longint;
rest, i: longint;
rest:=1;
divider := abs(divider);
for i := 1 to power do
rest := rest * num;
rest := rest mod divider;
myMod := rest;
assign(text, 'input.txt');
{rewrite(text);
writeln(text, 1);
close(text);}
reset(text);
read(text, a);
writeln('a=', a);
close(text);
n := 0;
repeat
n := n + 1;
until MyMod(n, n, a) = 0;
writeln('n=', n);
assign(text, 'output.txt');
rewrite(text);
writeln(text, n);
{reset(text);
read(text, n);
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
var a: array[0..100,0..100] of integer;
n, m, i, j, max, col: integer;
begin
read(n);
read(m);
for i: =0 to n-1 do
for j: =0 to m-1 do
begin
read(a[i,j]);
if max< a[i,j] then max: =a[i,j];
end;
for i: =0 to n-1 do
for j: =0 to m-1 do
if max=a[i,j] then begin inc(col); break; end;
writeln(col);
for i: =0 to n-1 do
for j: =0 to m-1 do
if max=a[i,j] then begin write(i, ' '); break; end;
end.
var
a, n: longint;
text: textfile;
function myMod(num, power, divider: longint): longint;
var
rest, i: longint;
begin
rest:=1;
divider := abs(divider);
for i := 1 to power do
begin
rest := rest * num;
rest := rest mod divider;
end;
myMod := rest;
end;
begin
assign(text, 'input.txt');
{rewrite(text);
writeln(text, 1);
close(text);}
reset(text);
read(text, a);
writeln('a=', a);
close(text);
n := 0;
repeat
n := n + 1;
until MyMod(n, n, a) = 0;
writeln('n=', n);
assign(text, 'output.txt');
rewrite(text);
writeln(text, n);
close(text);
{reset(text);
read(text, n);
writeln('n=', n);
close(text);}
end.