CodeForces 611 A. New Year and Days(水~)

来源:互联网 发布:大众软件 故事合集 编辑:程序博客网 时间:2024/05/16 17:12

Description
两种询问问每周和每月的第x天在2016年有几个
Input
两种询问
x of week(1<=x<=7)
x of month(1<=x<=31)
Output
输出每周和每月的第x天在2016年有几个
Sample Input
4 of week
Sample Output
52
Solution
水题~
Code

#include<cstdio>#include<iostream>#include<cstring>using namespace std;int d;char s1[3],s2[6];int main(){    while(~scanf("%d%s%s",&d,s1,s2))    {        if(s2[0]=='w')        {            if(d==5||d==6)printf("53\n");            else printf("52\n");        }        else         {            if(d<=29)printf("12\n");            else if(d==30)printf("11\n");            else if(d==31)printf("7\n");        }    }    return 0;}
0 0