Дамп всех задач
This commit is contained in:
25
Pascal/24.10.16/Program2.pas
Normal file
25
Pascal/24.10.16/Program2.pas
Normal file
@@ -0,0 +1,25 @@
|
||||
var
|
||||
a, b, c, n, i,j: int64;
|
||||
gg: boolean;
|
||||
|
||||
begin
|
||||
gg := false;
|
||||
j:=0;
|
||||
read(n);
|
||||
a := 1;
|
||||
b := 1;
|
||||
for i := 1 to ((n*n)-1) do
|
||||
begin
|
||||
c := a + b;
|
||||
a := b;
|
||||
b := c;
|
||||
j:=j+1;
|
||||
if c mod n = 0 then
|
||||
begin
|
||||
gg := true;
|
||||
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
if gg then write('true ',j) else write('false ',j);
|
||||
end.
|
||||
Reference in New Issue
Block a user