Ответ:
незнаю правильно или нет, но:
1 var
2 a, b, c, n, i: integer;
3
4 begin
5 write ( 'n = ');
6 readoin(n);
7 a : = 1;
8 b : = 1;
9 for i : = 1 to n do
10 begin
11 write( ' ', a);
12 c : = a + b;
13 a : = b;
14 b : = c;
15 end;
16 readin
17 end.
#python
a, b = 1, 0
N = int(input("N="))
print(0, end=" ")
for _ in range(N-1):
k = a + b
a, b = b, k
print(k,end=" ")
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
незнаю правильно или нет, но:
1 var
2 a, b, c, n, i: integer;
3
4 begin
5 write ( 'n = ');
6 readoin(n);
7 a : = 1;
8 b : = 1;
9 for i : = 1 to n do
10 begin
11 write( ' ', a);
12 c : = a + b;
13 a : = b;
14 b : = c;
15 end;
16 readin
17 end.
#python
a, b = 1, 0
N = int(input("N="))
print(0, end=" ")
for _ in range(N-1):
k = a + b
a, b = b, k
print(k,end=" ")