View Code of Problem 8

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

	}
	return 0;

}

Double click to view unformatted code.


Back to problem 8