#include <stdio.h> int fun(int x) { int rat=0; if(x==1 || x==3 || x==5 || x==7 || x==8 || x==10 || x==12) rat=31; else if(x==2) rat=29; else rat=30; return rat; } int main() { int n; int i,j; int sum,res,flag; char a[]="鄂A00001"; int b; scanf("%d",&n); getchar(); while(n--) { sum=0; res=0; gets(a); if(n!=0) getchar(); b=a[7]-'0'; for(i=1;i<=12;i++) { flag=0; sum=fun(i); for(j=1;j<=sum;j++) { if(b==0) { if((j%10)==(b+1) || (j%10)==9) flag++; } else { if((j%10)==(b+1) || (j%10)==(b-1)) flag++; } } res+=flag; } if(b==0) res--; printf("%d\n",365-res); } return 0; } |
Double click to view unformatted code.