#include<stdio.h> #include<string.h> void main() { int N; int day[10] = { 78,71,79,72,72,72,72,72,71,71 }; scanf("%d", &N); while (N--) { char str[1000]; scanf("%s", str); int n = str[strlen(str) - 1] - '0'; printf("%d\n", 365 - day[n]); } } |
Double click to view unformatted code.