闰年条件:1)能被4整除,但不能被100整除

     2)能被4整除,又能被400整除(能被400整除的,肯定能被4整除)

 

#include<iostream>
#include<cstdio>
using namespace std;

int main()
{
	int a;
	cin>>a;
	if(a%4==0 &&a%100!=0 || a%400==0)	cout<<"yes!"<<endl;
	else	cout<<"no!"<<endl;
}

  

posted on 2017-04-22 22:15  王小东大将军  阅读(342)  评论(0编辑  收藏  举报