08/12/16 22:06:25
>>17 >>16を使うのか。
#include <stdio.h>
int fibnum(int limit){
int new=1,pre=0,work,result;
while(new<=limit){
work=new; new=work+pre; pre=work;
}
return pre;
}
int main(void){
int limit,result;
scanf("%d",&limit);
result=fibnum(limit);
printf("%d\n", result);
return 0;
}