6 条题解

  • 5
    @ 2024-10-20 12:01:40
    #include <iostream>
    using namespace  std;
    int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    int main(){
        int y , m;
        cin >> y >> m;
        if(y % 400 == 0 || ( y %4 == 0 && y % 100 != 0 ) ){
            days[2] = 29;
        }
        cout << days[m];
    }
    
    • 4
      @ 2024-10-20 12:02:49
      #include <iostream>
      using namespace std;
      int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
      int main(){
           int y,m;
           cin>>y>>m;
           if(y % 400 == 0 || ( y % 4 == 0 && y % 100 != 0 )){
                days[2] = 29;
           }
           cout<<days[m];
      }
      
      • 3
        @ 2024-10-20 12:03:53
        y,m=map(int,input().split())
        match m:
            case 4|6|9|11:
                print(30)
            case 2:
                if y%4==0 and y%100!=0 or y%400==0:
                    print(29)
                else:
                    print(28)
            case 1|3|5|7|8|10|12:
                print(31)
        
        • 3
          @ 2024-10-20 12:02:29
          
          #include <iostream>
          using namespace  std;
          int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
          int main(){
              int y , m;
              cin >> y >> m;
              if(y % 400 == 0 || ( y %4 == 0 && y % 100 != 0 ) ){
                  days[2] = 29;
              }
              cout << days[m];
          }
          
          
          • 2
            @ 2024-10-20 12:05:42
            #include <iostream>
            using namespace  std;
            int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
            int main(){
                int y , m;
                cin >> y >> m;
                if(y % 400 == 0 || ( y %4 == 0 && y % 100 != 0 ) ){
                    days[2] = 29;
                }
                cout << days[m];
            }
            
            
            • 1
              @ 2024-10-20 12:06:19
              
              #include <iostream>
              using namespace  std;
              int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
              int main(){
                  int y , m;
                  cin >> y >> m;
                  if(y % 400 == 0 || ( y %4 == 0 && y % 100 != 0 ) ){
                      days[2] = 29;
                  }
                  cout << days[m];
              }
              
              
              
              • 1

              信息

              ID
              1363
              时间
              1000ms
              内存
              256MiB
              难度
              6
              标签
              (无)
              递交数
              29
              已通过
              10
              上传者