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——判断是否闰年的更多相关文章

  1. 武汉科技大学ACM :1002: 零起点学算法66——反话连篇

    Problem Description 把输入的字符按照反着顺序输出 Input 多组测试数据  每组一行(每组数据不超过200个字符) Output 按照输入的顺序反着输出各个字符 Sample I ...

  2. 武汉科技大学ACM :1002: 零起点学算法38——求阶乘和

    Problem Description 输入一个正整数n(n<=10),计算 S=1!+2!+3!+...+n! Input 输入一个正整数n(n<=10)(多组数据) Output 输出 ...

  3. 武汉科技大学ACM:1010: 零起点学算法27——判断是否直角三角形

    Problem Description 输入三个整数,分别代表三角形的三条边长度,判断能否构成直角三角形 Input 输入3个整数a,b,c(多组数据,-5000000<a,b,c<500 ...

  4. Problem H: 零起点学算法28——参加程序设计竞赛

    #include<stdio.h> int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF) ||b ...

  5. Problem E: 零起点学算法25——判断是否直角三角形

    #include<stdio.h> int main() { int a,b,c; while(scanf("%d %d %d",&a,&b,& ...

  6. Problem D: 零起点学算法24——判断奇偶数

    #include<stdio.h> int main() { int a; while(scanf("%d",&a)!=EOF) ==) printf(&quo ...

  7. WUOJ-ACM :1003: 零起点学算法78——牛牛

    武汉科技大学ACM :1003: 零起点学算法78--牛牛Problem Description牛牛是一种纸牌游戏,总共5张牌,规则如下: 如果找不到3张牌的点数之和是10的倍数,则为没牛: 如果其中 ...

  8. 1163: 零起点学算法70——Yes,I can!

    1163: 零起点学算法70--Yes,I can! Time Limit: 1 Sec  Memory Limit: 64 MB   64bit IO Format: %lldSubmitted: ...

  9. 1164: 零起点学算法71——C语言合法标识符(存在问题)

    1164: 零起点学算法71——C语言合法标识符 Time Limit: 1 Sec  Memory Limit: 64 MB   64bit IO Format: %lldSubmitted: 10 ...

随机推荐

  1. switch case加条件语句(非等值) php

    <?php $s_level=rand(1,6); echo $s_level.'<br/>'; switch(true){ case $s_level<3 : echo 'l ...

  2. wordpress后台打开缓慢的临时解决方法

    解决方法是添加下面的主题在目前的代码在functions.php: //禁用Open Sans class Disable_Google_Fonts { public function __const ...

  3. acdream暴力专场中的优美暴力

    F - 小晴天老师系列——苹果大丰收 Time Limit: 2000/1000MS (Java/Others)    Memory Limit: 128000/64000KB (Java/Other ...

  4. IO通信

    DeviceIoControl 发送控制代码到指定设备驱动程序 参数解释: hDevice Long,设备句柄 dwIoControlCode Long,应用程序调用驱动程序的控制命令,就是IOCTL ...

  5. css的!important规则对性能有影响吗

    最近在做项目中发现很多CSS代码里面都使用!important去覆盖原有高优先级的样式.按照常理来说,越是灵活的东西,需要做的工作就会更多.所以想当然的认为像!important这样灵活.方便的规则如 ...

  6. jboss部署应用

    简单的部署应用. 第一种方法是直接写JSP代码,然后放到指定的WAR文件夹中. 第二种,是同时META-INF下的application.xml文件,然后用JAR -CF编成WAR,再集合JSP形成E ...

  7. 使用SQLiteDatabase进行数据库操作的步骤

    1.获取SQLiteDatabase对象,它代表了与数据库的连接.2.调用SQLiteDatabase的方法来执行SQL语句.3.操作SQL语句的执行结果,比如用SimpleCursorAdapter ...

  8. HDU_2056——相交矩形的面积

    Problem Description Given two rectangles and the coordinates of two points on the diagonals of each ...

  9. bfs 记录和打印最短路径

    Poj3984 迷宫问题 #include <iostream> #include <algorithm> #include <cstdio> #include & ...

  10. Linux grep 命令中的正则表达式详解

    在 Linux .类 Unix 系统中我该如何使用 Grep 命令的正则表达式呢? Linux 附带有 GNU grep 命令工具,它支持扩展正则表达式(extended regular expres ...