C/C++の宿題を片付けます 120代目at TECH
C/C++の宿題を片付けます 120代目 - 暇つぶし2ch23:デフォルトの名無しさん
08/12/16 22:03:24
>>16ー17
#include <stdio.h>
/*ここに関数を記述*/
int fibnum(int limit) {
int a,b,c;
for(a=1,b=1,c=0; c<=limit; c=a+b) {a=b; b=c;}
return b;
}
int main(void){
int limit,result;
scanf("%d",&limit);
result=fibnum(limit);
printf("%d\n", result);
return 0;
}



次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch