为什么是80
查看原帖
为什么是80
1409448
WXY_ShiXiaoJi楼主2024/7/29 14:33
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,s,y;
    cin>>n>>y;
    s=(n%4==0 && n%100!=0 || n%400==0)?1:0;
    if(s==1 && y==2){
        cout<<"29";
    }else if(y==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12){
        cout<<"31";
    }else{
        cout<<"30";
    }
    return 0;
}
2024/7/29 14:33
加载中...