View Code of Problem 8

#include<stdio.h>
#include<string.h>
int main()
{
	int t,a[10]={287,294,286,293,293,293,293,293,294,294};
	scanf("%d",&t);
	while(t--)
	{
		char a[100];
		scanf("%s",&a);
		int len = strlen(a);
		int x=a[len-1]-'0';
		printf("%d\n",a[x]);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 8