暴力解法
2026-07-26 23:38:13
发布于:浙江
11阅读
0回复
0点赞
只要一个一个月的判断就行
#include<iostream>
using namespace std;
int main(){
int w;
cin>>w;
if((w+12)%7==5)cout<<1<<endl;
if((w+43)%7==5)cout<<2<<endl;
if((w+71)%7==5)cout<<3<<endl;
if((w+102)%7==5)cout<<4<<endl;
if((w+132)%7==5)cout<<5<<endl;
if((w+163)%7==5)cout<<6<<endl;
if((w+193)%7==5)cout<<7<<endl;
if((w+224)%7==5)cout<<8<<endl;
if((w+255)%7==5)cout<<9<<endl;
if((w+285)%7==5)cout<<10<<endl;
if((w+316)%7==5)cout<<11<<endl;
if((w+346)%7==5)cout<<12<<endl;
return 0;
}
这里空空如也







有帮助,赞一个