武汉科技大学ACM :1002: 零起点学算法28——判断是否闰年
Problem Description
输入年份,判断是否闰年
Input
输入一个整数n(多组数据)
Output
如果是闰年,输出yes,否则输出no(每组数据一行)
Sample Input
2000
Sample Output
yes
我的代码:
#include<stdio.h>
int main()
{
int year;
while(scanf("%d",&year)!=EOF)
{ if((year%== && year%!=) || (year%==) )
{
printf("yes\n");
}
else
{
printf("no\n");
}
}
return ;
}
其他代码:
#include <iostream> using namespace std; int main()
{
int year;
while(cin>>year)
{
if( (year%==)&&(year%!=) || (year%==) )
{
cout<<"yes"<<endl; }
else
{
cout<<"no"<<endl;
} }
return ;
}
武汉科技大学ACM :1002: 零起点学算法28——判断是否闰年的更多相关文章
- 武汉科技大学ACM :1002: 零起点学算法66——反话连篇
Problem Description 把输入的字符按照反着顺序输出 Input 多组测试数据 每组一行(每组数据不超过200个字符) Output 按照输入的顺序反着输出各个字符 Sample I ...
- 武汉科技大学ACM :1002: 零起点学算法38——求阶乘和
Problem Description 输入一个正整数n(n<=10),计算 S=1!+2!+3!+...+n! Input 输入一个正整数n(n<=10)(多组数据) Output 输出 ...
- 武汉科技大学ACM:1010: 零起点学算法27——判断是否直角三角形
Problem Description 输入三个整数,分别代表三角形的三条边长度,判断能否构成直角三角形 Input 输入3个整数a,b,c(多组数据,-5000000<a,b,c<500 ...
- Problem H: 零起点学算法28——参加程序设计竞赛
#include<stdio.h> int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF) ||b ...
- Problem E: 零起点学算法25——判断是否直角三角形
#include<stdio.h> int main() { int a,b,c; while(scanf("%d %d %d",&a,&b,& ...
- Problem D: 零起点学算法24——判断奇偶数
#include<stdio.h> int main() { int a; while(scanf("%d",&a)!=EOF) ==) printf(&quo ...
- WUOJ-ACM :1003: 零起点学算法78——牛牛
武汉科技大学ACM :1003: 零起点学算法78--牛牛Problem Description牛牛是一种纸牌游戏,总共5张牌,规则如下: 如果找不到3张牌的点数之和是10的倍数,则为没牛: 如果其中 ...
- 1163: 零起点学算法70——Yes,I can!
1163: 零起点学算法70--Yes,I can! Time Limit: 1 Sec Memory Limit: 64 MB 64bit IO Format: %lldSubmitted: ...
- 1164: 零起点学算法71——C语言合法标识符(存在问题)
1164: 零起点学算法71——C语言合法标识符 Time Limit: 1 Sec Memory Limit: 64 MB 64bit IO Format: %lldSubmitted: 10 ...
随机推荐
- C++实现Log()日志函数
转载请注明原创:http://www.cnblogs.com/StartoverX/p/4600649.html 需求:Log()函数,能够自动根据时间记录日志信息,要求不定参数类型和参数个数. 第一 ...
- 转:MFC网络编程学习
要学习好网路编程,主要看以下几个方面: 1.掌握概念,诸如:同步(Sync)/异步(Async),阻塞(Block)/非阻塞(Unblock)等. 2.在实际Windows网络通信软件开发中,异步非阻 ...
- Install the Yeoman toolset
参照:http://yeoman.io/codelab/setup.html 1:$npm install --global yo bower grunt-cli 提示以下错误 npm ERR! /p ...
- Bundle类
1.新建一个Bundle类 Bundle bundle=new Bundle();2.Bundle类中放入数据(key-value的形式,另一个Activity里面取数据的时候,通过key值找出对应的 ...
- qt-solutions提供了8个开源项目
其实这是官方提供的源代码,至于为什么会另建项目,而没有整合到QT项目里去,我猜可能有2个原因: 1. 这几个项目本身不完善,并且也不是QT项目的核心,因此没有必要花精力去完善 2. 一定程度上可以维护 ...
- 设计模式(十四):Command命令模式 -- 行为型模式
1.概述 在软件设计中,我们经常需要向某些对象发送请求,但是并不知道请求的接收者是谁,也不知道被请求的操作是哪个,我们只需在程序运行时指定具体的请求接收者即可,此时,可以使用命令模式来 ...
- 2013第38周日Java文件上传下载收集思考
2013第38周日Java文件上传&下载收集思考 感觉文件上传及下载操作很常用,之前简单搜集过一些东西,没有及时学习总结,现在基本没啥印象了,今天就再次学习下,记录下自己目前知识背景下对该类问 ...
- HDU_2058——等差数列,子集,集合长度判断
Problem Description Given a sequence 1,2,3,......N, your job is to calculate all the possible sub-se ...
- Codeforces - ZeptoLab Code Rush 2015 - D. Om Nom and Necklace:字符串
D. Om Nom and Necklace time limit per test 1 second memory limit per test 256 megabytes input standa ...
- Best Time to Buy and Sell Stock IV 解答
Question Say you have an array for which the ith element is the price of a given stock on day i. Des ...