Fibonacci Again
2014-04-01 19:28
369 查看
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
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
#include<stdio.h> int main() { long n; while(scanf("%ld",&n) != EOF) if (n%4==2) printf("yes\n"); else printf("no\n"); return 0; }
相关文章推荐
- SeeLCSagain
- main()
- poj 1804 Brainman
- AIX常用命令
- 九度题目1436:Repair the Wall
- 2009 Multi-University Training Contest 4 - Host by HDU
- NPAIRS框架的理解
- AIX 操作系统日常维护须知
- Attribute name invalid for tag form according to TLD异常解决办法_gaigai_百度空间
- 物理DG角色转换: failover
- AIX学习笔记(更新中)
- container_of
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- 约束constraint的用法总结
- Calling CRDA to update world regulatory domain
- 【容斥原理】AOJ-557 Redraiment猜想2
- Grid Infrastructure Redundant Interconnect and ora.cluster_interconnect.haip (Doc ID 1210883.1)
- macbook air 使用记录3
- Grails 项目中使用日历插件
- GHD hair straightners are probably