文章
16
粉丝
402
获赞
21
访问
156.5k
#include<bits/stdc++.h>
using namespace std;
int tianshu[13] = {0,0,0,0,30,31,30,31,31,30,31,30,31}; //因为不要考虑跨年所以1,2,3,月天数不用管
int main(){
int month,day;
cin >> month;
cin >> day;
int sum = 0;
for (int i = 4; i < month; i++){
sum += tianshu[i]; //这里把四月的30天也加进来了,因为后面会减去12
}
sum = sum + day - 12; //注意这里的减去12
if ((sum + 4) % 7 == 0) cout << "Sunday";
if ((sum + 4) % ...
登录后发布评论
暂无评论,来抢沙发