Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
42337 | Songgy_King | 节气 | C++ | 通过 | 0 MS | 248 KB | 683 | 2024-02-25 11:51:31 |
#include<bits/stdc++.h> using namespace std; int x,y; int month[24]={1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12}; int day[24]={5,20,4,19,5,20,4,19,5,20,5,21,6,22,7,22,7,22,8,23,7,22,7,21}; string jq[24]={"XH","DH","LC","YS","JZ","CF","QM","GY","LX","XM","MZ","XM","XZ","XS","DX","LQ","CS","QF","HL","SJ","LD","XX","DX","DZ"}; int main() { cin>>x>>y; for(int i=0;i<24;i++){ if(month[i]==x&&day[i]==y){ cout<<jq[i]; return 0; } } for(int i=0;i<24;i++){ if(x==12&&y>day[23]){ cout<<jq[0]; return 0; } else if(x>month[i]) continue; else if(x==month[i]&&y<day[i]||x<month[i]){ cout<<jq[i]; return 0; } } return 0; }