http://e-tutor.itsa.org.tw/e-Tutor/mod/programming/view.php?id=2654 費式數列是很經典的題目每一個數目為前面兩個加總
#include<stdio.h>
int main(){
int n,a=1,b=1,temp,i,num;
scanf("%d",&n);
for(i=2;i<=n;i++){
temp=a;
a=b;
b=a+temp;
}
printf("%d\n",a);
/*
題目:[C_MM103-易] 費式數列
作者:1010
時間:西元 2016 年 7 月 */
}