标题:Fibonacci 问题
取消只看楼主
利剑出鞘
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-5-18
 问题点数:0 回复次数:1 
Fibonacci 问题
Problem Description
There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).

Input
Input consists of a sequence of lines, each containing an integer n. (n < 1,000,000).

Output
Print the word "yes" if 3 divide evenly into F(n).

Print the word "no" if not.

Sample Input
0
1
2
3
4
5

Sample Output
no
no
yes
no
no
no
搜索更多相关主题的帖子: Fibonacci 
2008-10-02 19:56
利剑出鞘
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-5-18
得分:0 
回复 2# 守鹤 的帖子
Compiling...
150.c
d:\msdev98\bin\1\150.c(3) : error C2018: unknown character '0xa3'
d:\msdev98\bin\1\150.c(3) : error C2018: unknown character '0xbb'
d:\msdev98\bin\1\150.c(6) : error C2085: 'main' : not in formal parameter list
d:\msdev98\bin\1\150.c(6) : error C2143: syntax error : missing ';' before '{'
d:\msdev98\bin\1\150.c(9) : error C2143: syntax error : missing ';' before 'type'
d:\msdev98\bin\1\150.c(9) : error C2143: syntax error : missing ';' before 'type'
d:\msdev98\bin\1\150.c(9) : error C2143: syntax error : missing ')' before 'type'
d:\msdev98\bin\1\150.c(9) : error C2143: syntax error : missing ';' before 'type'
d:\msdev98\bin\1\150.c(9) : error C2065: 'i' : undeclared identifier
d:\msdev98\bin\1\150.c(9) : warning C4552: '<' : operator has no effect; expected operator with side-effect
d:\msdev98\bin\1\150.c(9) : error C2059: syntax error : ')'
d:\msdev98\bin\1\150.c(10) : error C2146: syntax error : missing ';' before identifier 'scanf'
d:\msdev98\bin\1\150.c(13) : warning C4013: 'fibo' undefined; assuming extern returning int
d:\msdev98\bin\1\150.c(14) : warning C4098: 'Fibo' : 'void' function returning a value
d:\msdev98\bin\1\150.c(19) : error C2084: function 'void __cdecl Fibo(int )' already has a body
执行 cl.exe 时出错.

150.obj - 1 error(s), 0 warning(s)
2008-10-02 22:52



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-236153-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.577181 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved