codeforces goodbye 2015 A. New Year and Days
http://codeforces.com/contest/611/problem/A 题意:两种查询,一种是 x of week,x为1.。7,对应输出2016年星期x有多少天。另一种为x of month ,对应输出2016年至少有x天的月份有多少天。 思路:直接搞。。。。竟然脑残被hack了。。。sad.
1#include <cstdio>
2#include <cstring>
3#include <iostream>
4#include <algorithm>
1using namespace std;
2const int inf = 0x3f3f3f3f;
3int x;
4char st[25],nouse[33];
5int main()
6{
1 scanf("%d %s %s",&x,nouse,st);
2 if (st[0]=='w')
3 {
4 if (x==6||x==5)
5 {
6 cout<<53<<endl;
7 }
8 else
9 {
10 cout<<52<<endl;
11 }
1 }
2 else
3 {
4 if (x<=29)
5 {
6 puts("12");
7 }
8 else if (x<=30)
9 {
10 puts("11");
11 }
12 else
13 {
14 puts("7");
15 }
16 }
return 0;
}