codeforce 611A New Year and Days

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;

char num[1000];
char s[1000];
int week[10];

int main()
{
    week[1]=1;
    week[2]=1;
    week[3]=1;
    week[4]=1;
    week[5]=2;
    week[6]=2;
    week[7]=1;

    scanf("%s",num);
    scanf("%s",s);
    scanf("%s",s);
    int ans=0;
    int n=0;
    for(int i=0;num[i];i++) n=n*10+num[i]-'0';

    if(s[0]=='w') ans=51+week[n];


    else{
        if(n<=29) ans=12;
        else if(n<=30) ans=11;
        else ans=7;
    }
    printf("%d\n",ans);
    return 0;
}

 

posted @ 2016-01-02 09:41  Fighting_Heart  阅读(138)  评论(0编辑  收藏  举报