|
|
back to boardwhat's wrong? #include <stdio.h> int main(void) { int n,k,i; char c; scanf("%d",&n); while(n--){ scanf("%1s%d",&c,&k); if((c=='a'||c=='h')&&(k==1||k==8)) {printf("2\n"); continue;} if((c=='a'||c=='h')&&(k==2||k==7)) {printf("3\n"); continue;} if((c=='b'||c=='g')&&(k==1||k==8)) {printf("3\n"); continue;} if((c=='b'||c=='g')&&(k==2||k==7)) {printf("4\n"); continue;} if(c<'b'||c>'g') {printf("4\n"); continue;} if(k<2||k>7) {printf("4\n"); continue;} if((c=='b'||c=='g') || (k==2||k==7)) {printf("6\n"); continue;} printf("8\n"); } return 0; } |
|
|