文章
35
粉丝
599
获赞
6
访问
309.9k
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
using namespace std;
int month[10]={18,31,30,31,31,30,31,30,31};
char week[8][10]={"Monday","Tuesday","Wednesday","Tursday","Friday","Saturday","Sunday"};
int main() {
int n,m,x,sum=0;
scanf("%d",&n);
scanf("%d",&m);
//for(int i=0;i<9;i++){
x=n-4;
//x=month[n-4]+m;
if(n==4)sum=m-12+3;
//printf("%s",week[sum%7]);
else{
for(int i=0;i<=x;i++){
sum+=month[i];
}
sum+=m;
}
//sum+=3;
printf("%s",week[sum%7]);
}
登录后发布评论
可以随机输入数据和其他正确答案的输出比对一下