Фибоначчи:
a = b = 1;
i = 0;
while(i < 10) {
c = a + b;
?(c);
a = b;
b = c;
i = i + 1;
}
Результат:
PRINT: 2
PRINT: 3
PRINT: 5
PRINT: 8
PRINT: 13
PRINT: 21
PRINT: 34
PRINT: 55
PRINT: 89
PRINT: 144
CONTEXT:
'a' is 89
'b' is 144
'c' is 144
'i' is 10
P.S. Вот и кончился отпуск.
No comments:
Post a Comment