View Code of Problem 8

#include<stdio.h>
#include<string.h>
int main()
{
	int n;
	scanf("%d",&n);
	char str[100];
	int a[10]={78,71,79,72,72,72,72,72,71,71};
	int len;
	while(n>0)
	{
		getchar();
		scanf("%s",str);
		len = strlen(str);
		int k = str[len-1]-48;
		printf("%d\n",365-a[k]);
		n--;
		
	}
	return 0;
 } 

Double click to view unformatted code.


Back to problem 8