码迷,mamicode.com
首页 > 其他好文 > 详细

Leap year

时间:2020-05-01 18:23:31      阅读:49      评论:0      收藏:0      [点我收藏+]

标签:cout   str   namespace   hat   ret   out   ace   def   std   

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

Leap year

标签:cout   str   namespace   hat   ret   out   ace   def   std   

原文地址:https://www.cnblogs.com/lym11248/p/12814149.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!