View Code of Problem 8

#include<stdio.h>
#include<string.h>
int main()
{
	int a[11]={35,43,36,36,36,36,36,36,36,35,36};
	int T;
	scanf("%d",&T);
	getchar();
	while(T>0)
	{
		char str[20];
		gets(str);
		int len;
		len=strlen(str);
		int sum;
		if(str[len-1]=='0') sum=a[9]+a[1];
		else sum=a[str[len-1]-'0'+1]+a[str[len-1]-'0'-1];
		printf("%d\n",365-sum);
		T--;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 8