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

 #include<iostream>/*打表找规律*/
using namespace std;
int main(){
int n;
while(cin>>n){
if(n%==) cout<<"yes"<<endl;
else cout<<"no"<<endl;
}return ;
}

1021 Fibonacci Again (hdoj)的更多相关文章

  1. PAT(B) 1021 个位数统计(Java)

    题目链接:1021 个位数统计 (15 point(s)) 代码 /** * Score 15 * Run Time 93ms * @author wowpH * @version 1.0 */ im ...

  2. hdu 1021 Fibonacci Again(变形的斐波那契)

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1021 Fibonacci Again Time Limit: 2000/1000 MS (Java/Ot ...

  3. HDU 1021 Fibonacci Again( 同余水 )

    链接:传送门 题意:现在给出 Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).问第 n 项能不能整除 ...

  4. hdu4786 Fibonacci Tree (最小生成树)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4786 题意:给定图的n个点和m条双向边,告诉你每条边的权值.权值为1表示该边是白边,权值为0表示该边为 ...

  5. UVa 11582 - Colossal Fibonacci Numbers!(数论)

    链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  6. Project Euler 31 1000-digit Fibonacci number( DP )

    题意:在无限硬币的情况下能组成200的方案数有多少个 思路:DP,设数组 dp[ n ] [ k ] 代表前 n 种硬币能够组成 k 元的方案数,那么就能得到 dp [ n ] [ k ] = dp ...

  7. hdu 4786 Fibonacci Tree(最小生成树)

    Fibonacci Tree Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) T ...

  8. hau1021 Fibonacci Again(递归)

    Fibonacci Again Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)T ...

  9. URAL1133. Fibonacci Sequence(二分)

    1133 刚开始还用记忆化推了下公式 后来发现数是非常大的 二分 然后就是精度错误 中间值会很大 乱七八糟的改 #include <iostream> #include<cstdio ...

随机推荐

  1. [Head First Python]4. summary

    1- strip()方法可以从字符串去除不想要的空白符 (role, line_spoken) = each_line.split(":", 1) line_spoken = li ...

  2. pm2安装及常用命令

    安装:npm install -g pm2 启动程序:pm2 start <app_name|id|all> 列举进程:pm2 list 退出程序:pm2 stop <app_nam ...

  3. iOS开发多线程-多线程技术1

    一.基本概念 1.什么是进程 进程就是指在系统中正在运行的一个应用程序 每个应用之间是相互独立的 每个进程都运行在其专有的并且受保护的内存空间内. 2.什么是线程 一个进程想要执行程序,就必须需要一个 ...

  4. Bitmap 与ImageSource之间的转换

    public class ImageConverter { [DllImport("gdi32.dll", SetLastError = true)] private static ...

  5. 分布式文件系统 Mogilefs 安装步骤

    我这里的环境都是 RHEL 5 的环境. MySQL 数据库 和 tracker 都放到一台服务器上, 为 192.168.2.85 storage server两台, 分别为 192.168.2.9 ...

  6. X windows的底层实现机制

    Qt在Linux上运行崩溃了,很可能的原因是对于X11机制的不了解.很可能是UI代码里面对窗口的操作不规范而导致Qt内部的BUG暴露出来.具体UI实现代码我也没有看.是别人维护的.打算今天去看下代码, ...

  7. poj 1703(带权并查集)

    Find them, Catch them Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 31840   Accepted: ...

  8. mongoDB global,startUplog

    1,show logs (Ruiy看到一些人干些事就跟拉shit一样(磨叽),就来气,娃儿的,还不知所谓,抱怨,叫器一大堆!!!,喝喝,就这它还三心二意学一个故事中的主人公小小明上课偷打`皮卡`玩,三 ...

  9. javac命令详解(下)

    摘自http://blog.csdn.net/hudashi/article/details/7058999 javac命令详解(下)                             -ver ...

  10. Young Table(暴力,交换位置)

     Young Table Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submi ...