1 条题解

  • 1
    @ 2025-2-15 10:26:23
    #include <bits/stdc++.h>
    using namespace std;
    int days[13] = {0 , 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 };
    int main(){
       int y , m , d;
       int ans = 0;
       cin >> y >> m >> d;
       if(y % 400 == 0 || (y % 4 == 0 && y % 100 != 0)){
          days[2] = 29;
       }
       for(int i = 0; i < m; i++){
          ans += days[i];
       }
       cout << ans + d;
    
       
       
    
      
        
      
    
    
    
    
    
    
       return 0;
    }
    
    • 1

    信息

    ID
    391
    时间
    1000ms
    内存
    64MiB
    难度
    6
    标签
    递交数
    43
    已通过
    13
    上传者