View Code of Problem 8

#include <stdio.h>
#include <string.h>
int main()
{
	int T, len;
	char a[20];
	scanf("%d", &T);
	while (T--)
	{
		scanf("%s", a);
		len = strlen(a);
		if (a[len - 1] == '0' || a[len - 1] == '2')printf("287\n");
		else if (a[len - 1] == '1' || a[len - 1] == '9')printf("294\n");
		else printf("293\n");
	}
}

Double click to view unformatted code.


Back to problem 8