View Code of Problem 8

#include <stdio.h>
#include <string.h>
int main(void) {
    int n;
	scanf("%d",&n);
	while (n--){
		char t[100000];
		int s;
		scanf("%s",&t);
		s=strlen(t);
		s=(int)(t[s-1]-48);
		if (s>2&&s<8)
			printf("293\n");
		else
		switch (s) {
		case 0:printf("287\n");break;
		case 1:printf("294\n");break;
		case 2:printf("286\n");break;
		case 8:printf("294\n");break;
		case 9:printf("294\n");
		}

	}
        return 0;
   }

Double click to view unformatted code.


Back to problem 8