View Code of Problem 8

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

	      
	}
	return 0;

}

Double click to view unformatted code.


Back to problem 8