#include<bits/stdc++.h> using namespace std; int main(){ int n,op; scanf("%d\n",&n); while(n--){ char c[10]; int day = 0; int time[12] = {31,28,31,30,31,30,31,31,30,31,30,31}; scanf("%s",c); op = c[strlen(c) - 1] - '0'; for(int i = 0;i<12;i++){ for(int j = 1;j <= time[i];j++){ if(( j - 1 == op || j + 1 == op ) || ( (j - 1) % 10 == op || (j + 1) % 10 == op )){ day++; } } } day = 365 - day; cout<<day<<endl; } return 0; } |
Double click to view unformatted code.