python版
提示:如果用的是python2.7,把print(a)改成print a
i=0 print(i) a=1 print(a) b=1 print(b) for i in range(100): temp=b b=a+b; a=temp print(b)
c++版
#include <cstdlib> #include <iostream> #include <cstdio> using namespace std; int main() { long long a, b, max, temp=0; max=10;//可把10改成任意整数。 cout << temp << endl; cout << a << endl; cout << b << endl; for (int i = 0; i < max; i++) { b = temp; b = a + b; a = temp cout << b << endl; } system("pause"); return 0; }