NEUQACM OJ:1299【白书习题】年份

//闰年是公历中的名词,能被4整除但不能被100整除,或能被400整除的年份即为闰年。
include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;//输入年份
    //if语句判断是否是闰年。注意是==,而不是赋值符号=
    if(n%4==0 && n%100!=0 || n%400==0)
       cout<<"yes"<<endl;
    else
        cout<<"no"<<endl;
    return 0;


相关文章:

  • 2021-10-12
  • 2022-01-02
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2021-11-17
  • 2021-12-02
  • 2021-11-29
猜你喜欢
  • 2021-08-23
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2021-04-08
  • 2021-07-08
相关资源
相似解决方案