1 条题解
-
0
我辛辛苦苦敲了五分钟,居然没数据awa...
#include<bits/stdc++.h> #define int long long #define INF 0x3f3f3f using namespace std; int m[50]={0,0,31,28,31,30,31,30,31,31,30,31,30,31}; int f[50]; int x,y; signed main(){ for(int i=1;i<=12;i++) f[i]=f[i-1]+m[i]; scanf("%d,%d",&x,&y); int k=f[x]+y; int d=(k%7+5)%7; cout<<"星期"; if(d==1)cout<<"一"; else if(d==2)cout<<"二"; else if(d==3)cout<<"三"; else if(d==4)cout<<"四"; else if(d==5)cout<<"五"; else if(d==6)cout<<"六"; else if(d==0)cout<<"日"; cout<<","; if(d==6||d==0)cout<<"NO"; else cout<<"YES"; return 0; }
- 1
信息
- ID
- 72
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 10
- 标签
- 递交数
- 4
- 已通过
- 0
- 上传者