3 条题解

  • 2
    @ 2025-1-4 14:23:55
    #include<iostream>
    #include<cmath>
    using namespace std;
    int main()
    {
    int y, m;
    cin >> y >> m;
    if(m == 4 || m == 6 || m == 9 || m == 11)
    cout << 30;
    else if(m == 2)
    {
    if(y % 4 == 0 && !(y % 100 == 0 && y % 400 != 0))
    cout << 29;
    else
    cout << 28;
    }
    else
    cout << 31;
    return 0;
    }
    

    有标志认证,属三无产品,请大家放心食用

    • 0
      @ 2025-2-10 17:47:37
      #include<bits/stdc++.h>
      #define long long int 
      using namespace std;
      const int N=1e5+5,INF=0x3f3f3f3f;
      int n,a,yue[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
      int main()
      {
      	cin>>n>>a;
      	if((n%4==0&&n%100!=0||n%400==0)&&a==2)yue[a]++;
      	cout<<yue[a];
      	return 0;
      }
      
      • 0
        @ 2024-8-9 17:25:43
        #include<iostream>
        #include<cmath>
        using namespace std;
        int main()
        {
        	int y, m;
        	cin >> y >> m;
        	if(m == 4 || m == 6 || m == 9 || m == 11)
        		cout << 30;
        	else if(m == 2)
        	{
        		if(y % 4 == 0 && !(y % 100 == 0 && y % 400 != 0))
        			cout << 29;
        		else
        			cout << 28;
        	}
        	else
        		cout << 31;
        	return 0;
        }
        
        • 1

        信息

        ID
        3130
        时间
        1000ms
        内存
        256MiB
        难度
        1
        标签
        递交数
        85
        已通过
        37
        上传者