4 solutions

  • 0
    @ 2025-7-5 9:42:01
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a,b,n;
        cin>>a>>b;
        if(b==1||b==3||b==5||b==7||b==8||b==10||b==12)
        {
            cout<<"31";
        }
        else if(b==2)
        {
            if(a%4==0 && a%100!=0 || a%400==0)
            {
                cout<<"29";
            }
            else cout<<"28";
        }
        else cout<<"30";
    	return 0;
    }
    

    Information

    ID
    2575
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    77
    Accepted
    30
    Uploaded By