求某年月份中天数最简单的代码
查看原帖
求某年月份中天数最简单的代码
1183103
lp2839448514楼主2024/12/12 23:44
#include <iostream>
#include <cmath>
using namespace std;

typedef long long ll;

int main() {
    int n,m;
    cin>>n>>m;
    int mounth[]={0,31,(n%4==0&&n%100!=0)||n%400==0?29:28,31,30,31,30,31,31,30,31,30,31};
    cout<<mounth[m];
    return 0;
}
2024/12/12 23:44
加载中...