Online Judge【CodeForces】[611A]New Year and Days问题描述 问题分析找规律题目已知平年有52周零1天闰年有52周零2天2016年为闰年,并且第一天为周五所以一年有53个周五周六,其余为52一年有12个月有29号一年有11个月有30号一年有7个月有31号 1 2 3 4 5 6 7 8 9 10 11 12 #include<stdio.h> int main() { int n; char s[10]; while(scanf("%d of %s",&n,s)!=EOF) { if(s[0]=='w') printf("%d\n",n==5||n==6?53:52); else printf("%d\n",n<30?12:(n==30?11:7)); } return 0; }