View Code of Problem 8

#include<stdio.h>
#include<string.h>
int main(){
	int a,n,sum=0;
	char str[10],x;
		scanf("%d%",&n);  //换行
       
	while(n--)
	{
		gets(str);
		a=strlen(str);
		x=str[a-1];
		if (x=='2')
			sum=286;
		else if(x=='0')
		    sum=287;
		else if(x=='1' || x=='9'||x=='8')
			sum=294;
		else 
			sum=293;
			printf("%d\n",sum);
	       

	}
	return 0;

}

Double click to view unformatted code.


Back to problem 8