int a = 0, b = 1;
for(int i=0;i<100;i++){
int tmp = b;
b = a + b;
a = tmp;
printf("%d ",a);
}
int fabo(int n){
if(n == 1 || n == 2)
return 1;
return fabo(n-1) + fabo(n-2);
}
int fabonacci[100] = {0, 1, 1};
int fabo(int n){
if(fabonacci[n] != 0)
return fabonacci[n];
fabonacci[n] = fabo(n-1) + fabo(n-2);
return fabonacci[n];
}
int a = 6, b = 8;
while(a != 0 && b != 0){
if(b > a)
swap(a, b);
a = a%b;
}
int gcd(int a, int b){
if(b == 0)
return a;
return gcd(b, a%b);
}
int n;
while(scanf("%d", &n) != EOF){
//...
}
計算多個數之間的最小公倍數n, 保證 n