|
Fibonacci Again
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 65 Accepted Submission(s) : 18Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).
InputInput consists of a sequence of lines, each containing an integer n. (n < 1,000,000).
OutputPrint the word "yes" if 3 divide evenly into F(n).
Print the word "no" if not. Sample Input0
1
2
3
4
5
Sample Outputno
no
yes
no
no
no
AuthorLeojay
代码:
#include<stdio.h>
int main() { long n; while(scanf("%ld",&n)!=EOF) { if((n-2)%4) printf("no\n"); else printf("yes\n"); }
return 0;
} |
HDU 1201 Fibonacci Again
最新推荐文章于 2023-03-20 11:18:28 发布
340

被折叠的 条评论
为什么被折叠?



