返回题解分享
讨论 / 题解分享/ 帖子详情

星期计算(结果填空) - 题解

#include<bits/stdc++.h>
using namespace std;
int main(){
	int res=1;
	int currentDay=6;
	for(int i = 1;i <= 22;i++){
		res = (res%7)*20%7;
	} 
	int nextDay=(currentDay+res - 1)%7 + 1;
	cout<<nextDay<<endl;
}
0 回复 0 转发 0 喜欢 1 阅读
回复 (0)
默认 最新
暂无回复,快来抢沙发!