View Code of Problem 8

#include<stdio.h> 
#include<string.h>
#include<math.h>

int main(){ 
    int i,j,n,len;
    char s[10];
    scanf("%d",&n);
    int a[10]={78,71,79,72,72,72,72,72,71,71};
    while(n--){
    	scanf("%s",s);
    	len=strlen(s)-1;
    	i=s[len]-48;
    	
    	printf("%d\n",365-a[i]);
	}
    return 0; 
     
}

Double click to view unformatted code.


Back to problem 8