文章

38

粉丝

56

获赞

67

访问

4.1k

头像
日期 题解:暴力至高
P1011 贵州大学机试题
发布于2025年3月9日 11:53
阅读数 95

//思路:纯粹暴力。
#include <bits/stdc++.h>
using namespace std;

int month[9]={-12,18,49,79,110,141,171,202,232};

int main()
{
    int m,d;
    cin>>m>>d;
    d+=month[m-4];
    if(d%7==3) cout<<"Sunday";
    else if(d%7==4) cout<<"Monday";
    else if(d%7==5) cout<<"Tuesday";
    else if(d%7==6) cout<<"Wednesday";
    else if(d%7==0) cout<<"Thursday";
    else if(d%7==1) cout<<"Friday";
    else if(d%7==2) cout<<"Saturday";
    return 0;
}

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发