文章

3

粉丝

0

获赞

15

访问

822

头像
打印日期 题解:暴力题解
P1410 华中科技大学机试题
发布于2025年3月20日 20:40
阅读数 220

#include<bits/stdc++.h>
#include<string>
using namespace std;
int mons[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
bool run(int y){
    if((y%400==0)||(y%4==0&&y%100!=0)){
        return true;
    }else{
        return false;
    }
}
int main(){
    int y,k;
    while(cin>>y>>k){
        int m=1,d=0;
        if(run(y)){
            mons[2]=29;
        }else{
            mons[2]=28;
        }
        while(k--){
            d++;
            if(d>mons[m]){
   &...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发