武汉科技大学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 ...
随机推荐
- Solr Update备注
参考资料: http://wiki.apache.org/solr/ExtractingRequestHandler#Sending_documents_to_Solr /update 标准的upda ...
- 客户端是选择Java Swing还是C# Winform
登录|注册 mentat的专栏 目录视图 摘要视图 订阅 [专家问答]韦玮:Python基础编程实战专题 [知识库]Swift资源大集合 [公告]博客新皮肤上线啦 ...
- 为什么我要使用一个20年前的IBM老键盘
为什么我要使用一个20年前的IBM老键盘 发表在 心得体会 | 3条评论 几天前,我在网上发了一张图片,想炫耀了一下我的新MacBook Pro笔记本强悍的多屏功能.没人感兴趣.但图上的那个老键盘却得 ...
- ural 1203. Scientific Conference
http://acm.timus.ru/problem.aspx?space=1&num=1203 #include <cstdio> #include <cstring&g ...
- android merge 标签的使用
<merge xmlns:android="http://schemas.android.com/apk/res/android"> <ToggleButton ...
- 动态SQL使用绑定变量
SQL> begin for i in 1..1000000 loop execute immediate 'insert into p1 values(i)' ; c ...
- BZOJ3433: [Usaco2014 Jan]Recording the Moolympics
3433: [Usaco2014 Jan]Recording the Moolympics Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 55 So ...
- 【转】如何在 Android 程序中禁止屏幕旋转和重启Activity
原文网址:http://www.cnblogs.com/bluestorm/p/3665890.html 禁止屏幕随手机旋转变化 有时候我们希望让一个程序的界面始终保持在一个方向,不随手机方向旋转而变 ...
- 数据加密算法---base64
简介 base64是把8位字符打散,转换成不被人直接识别的形式,严格来说它并不是加密算法,只能算做一种编码方式 原理 首先准备64个字符数组做为“数组库” ['A', 'B', 'C', ... 'a ...
- HDU5266---pog loves szh III (线段树+LCA)
题意:N个点的有向树, Q次询问, 每次询问区间[L, R]内所有点的LCA. 大致做法:线段树每个点保存它的孩子的LCA值, 对于每一次询问只需要 在线段树查询即可. #include <bi ...