View Code of Problem 8

#include<stdio.h>
int main()
{
	int n,j,y;
	char s[7],x;
	scanf("%d",&n);
	y=n;
	while(n>0)
	{
		scanf("%s",&s);
		x=s[6];
		if (x=='0')
			printf("287\n");
		else if (x=='1')
			printf("294\n");
		else if (x=='8')
			printf("294\n");
		else if (x=='9')
			printf("294\n");
		else if (x=='2')
			printf("287\n");
		else
			printf("293\n");
		n=n-1;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 8