#include <stdio.h> int main(){ int T; scanf("%d", &T); while(T--){ char str[8]; scanf("%s", str); int month[12]={31,28,31,30,31,30,31,31,30,31,30,31}; int cnt = 365; for(int i =0;i<12;i++){ for(int j=1;j<=month[i];j++){ int a = (j+ 1)%10 ; int b = (j- 1)%10 ; int c = str[7] - '0'; if(a == c || b ==c) cnt --; } } printf("%d\n",cnt); } } |
Double click to view unformatted code.