View Code of Problem 8

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
	int n;
	scanf("%d",&n);
	while(n--)
	{   
	    char a[10];
		gets(a);
		int i,k;
		k=strlen(a);
		if(a[k-1]=='0') i=78;
		if(a[k-1]=='1') i=71;
		if(a[k-1]=='2') i=79;
		if(a[k-1]=='3') i=72;
		if(a[k-1]=='4') i=72;
		if(a[k-1]=='5') i=72;
		if(a[k-1]=='6') i=72;
		if(a[k-1]=='7') i=72;
		if(a[k-1]=='8') i=71;
		if(a[k-1]=='9') i=71;
		printf("%d\n",365-i);	
	 } 
	return 0;
}

Double click to view unformatted code.


Back to problem 8