View Code of Problem 8

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stdbool.h>
typedef struct{
	char name[20];
	int flag;
}Children;

int main(){
	int n,t;
	int month[12]={31,28,31,30,31,30,31,31,30,31,30,31};	
	char s[100];
	scanf("%d",&n);
	while(n--){
		scanf("%s",&s);
		int count=0;
		int num=s[strlen(s)-1]-'0';
		for(int i=0;i<12;i++){
			for(int j=1;j<=month[i];j++){
				if((j+9)%10==num){
					count++;
				}
				if((j+1)%10==num){
					count++;
				}
			}
		}
		printf("%d\n",365-count);
	}
} 




	

Double click to view unformatted code.


Back to problem 8