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>
5
6using namespace std;
7const int inf = 0x3f3f3f3f;
8int x;
9char st[25],nouse[33];
10int main()
11{
12
13 scanf("%d %s %s",&x,nouse,st);
14 if (st[0]=='w')
15 {
16 if (x==6||x==5)
17 {
18 cout<<53<<endl;
19 }
20 else
21 {
22 cout<<52<<endl;
23 }
24
25 }
26 else
27 {
28 if (x<=29)
29 {
30 puts("12");
31 }
32 else if (x<=30)
33 {
34 puts("11");
35 }
36 else
37 {
38 puts("7");
39 }
40 }
41
42 return 0;
43}