每月天数

大严 · 发布于 2025-08-17 · 浏览 524 回复 3

include<bits/stdc++.h>

using namespace std; int main(){

int A,B;
cin>>A>>B;
if(A%4==0&&(A%100!=0||A%400==0))
{
    if(B==1||B==3||B==5||B==7||B==8||B==10||B==12)
    {
        cout<<"31";
    }
    else if(B==4||B==6||B==9||B==11)
    {
        cout<<"30";
    }
    else
    {
        cout<<"29";
    }
}
else
{
    if(B==1||B==3||B==5||B==7||B==8||B==10||B==12)
    {
        cout<<"31";
    }
    else if(B==4||B==6||B==9||B==11)
    {
        cout<<"30";
    }
    else
    {
        cout<<"28";
    }
}
return 0;

}

全部回复 共 3 条

  1. み柒壹ン #1 ·

    感谢你一辈子

  2. 俊奕 #2 ·

    (内容为空)

  3. 俊奕 #3 ·

    哈哈

发表回复