HDU1021
来源:互联网 发布:金蝶软件服务商 编辑:程序博客网 时间:2024/06/15 05:43
本文章仅用于笔记。部分知识点来源于网络,授权请联系作者(1091879478@qq.com)。
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 Sample Output
代码
注释
//规律 当n=3开始,后面的数值对3取余每四次一个循环
题目
Fibonacci Again
HDU-1021There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).
Print the word "no" if not.
012345
nonoyesnonono
代码
import java.util.Scanner;public class h1021{public static void main(String[] args){Scanner cin=new Scanner(System.in); while (cin.hasNextInt()){ int n=cin.nextInt();n=n+2;if ( n%4==0)System.out.println("yes");else System.out.println("no");}}}
注释
//规律 当n=3开始,后面的数值对3取余每四次一个循环
阅读全文
0 0
- hdu1021
- hdu1021
- hdu1021
- hdu1021
- HDU1021
- HDU1021
- HDU1021
- hdu1021
- hdu1021
- HDU1021
- HDU1021
- HDU1021
- HDU1021
- HDU1021
- HDU1021
- hdu1021(Fibonacci)
- HDU1021 水题
- HDU1021 Fibonacci Again
- 解决:Python-aiohttp.ClientPayloadError:Response payload is not completed
- Linux CENTOS6.* 安装rabbitMQ
- 关于U盘安装CentOS 7(CentOS-7-x86_64-DVD-1708.iso)的流程以及安装过程中的一些问题
- 服务器后台运行的优势和方法
- 网络编程(一)
- HDU1021
- Lock和synchronized的区别和使用
- 模板方法模式
- 如何从零设计结构清晰、操作友好的权限管理模块
- Spring 配置文件头部xmls解析
- android侧滑菜单
- [LeetCode] 26.Remove Duplicates from Sorted Array
- java设计模式之责任
- 学习记录5