文章
61
粉丝
137
获赞
18
访问
39.9k
#include<bits/stdc++.h>
using namespace std;
int main(){
int month ,day;
int days = 0;
cin >> month >> day ;
int months[] = {31 ,28 ,31 ,30 ,31 ,30 ,31 ,31 ,30 ,31 ,30 ,31} ;
string week[] = {"Monday" ,"Tuesday" ,"Wednesday" ,"Thursday" ,"Friday" ,"Saturday" ,"Sunday"};
//计算相隔多少天
if(month == 4) days = day - 12;
else days += (18 + day);
for(int i = 4 ;i < month - 1 ;i++){
days += months[i];
}
//换算成星期
cout << week[(3 + days )% 7] ;
return 0;
}
登录后发布评论
暂无评论,来抢沙发