#include <stdio.h> #include <string.h> int main() { int n,len; char a[30]; scanf("%d",&n); while(n>0) { scanf("%s",&a); len=strlen(a); if(a[len-1]=='0') printf("287\n"); else if(a[len-1]=='2') printf("286\n"); else if(a[len-1]=='1' || a[len-1]=='9' || a[len-1]=='8') printf("294\n"); else printf("293\n"); n--; } return 0; } |
Double click to view unformatted code.