View Code of Problem 8

#include<stdio.h>
#include<string.h>
void main(){
  int n;
  scanf("%d",&n);
  while(n--){
    char str[10];
    scanf("%s",str);
    int 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]=='8'||str[len-1]=='9') printf("294\n");
    else  printf("293\n");
  }
}

Double click to view unformatted code.


Back to problem 8