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