View Code of Problem 8

#include<stdio.h>
#include<string.h>
int main(){
int n,len,a,num;
char s[10];
scanf("%d",&n);
while(n--){
	num=0;
	getchar();
scanf("%s",s);
len=strlen(s);
a=s[len-1]-48;
if(a>=3&&a<=7)
printf("293\n");
else if(a==0)
printf("287\n");
else if(a==2)
printf("286\n");
else
printf("294\n");
}
}

Double click to view unformatted code.


Back to problem 8