Leap year

Leap year is defined as a year that divisible by 400 or not divisible by 100 but divisible by 4.

#include <iostream>using namespace std;


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

:D

猜你喜欢

转载自www.cnblogs.com/lym11248/p/12814149.html