{{{~cpp #include #include using namespace std; int testcase, testNum; char list[50][50]; char testlist[20][50]; char temp[255]; int row, col, i, j, k, n; bool check(int ax, int ay, char *temp) { int x=ax; int y=ay; int length = strlen(temp); //북 0, -1 for(n=0; n=0; n++, y--) { if(list[x][y]!=temp[n]) break; if(n==length-1) return true; } //북동 +1, -1 x=ax; y=ay; for(n=0; n=0; n++, x++, y--) { if(list[x][y]!=temp[n]) break; if(n==length-1) return true; } //동 +1, 0 x=ax; y=ay; for(n=0; n=0 && y=0; n++, x--) { if(list[x][y]!=temp[n]) break; if(n==length-1) return true; } //북서 -1, -1 x=ax; y=ay; for(n=0; n=0 && y>=0; n++, x--, y--) { if(list[x][y]!=temp[n]) break; if(n==length-1) return true; } return false; } void calculate() { bool exitCond; for(k=0; k> testcase; cin.getline(temp, 255); while(testcase--) { cin.getline(temp, 255); cin >> row >> col; for(i=0; i>list[i][j]; if(list[i][j]>=65 && list[i][j]<=90) list[i][j] = list[i][j] + 32; } } cin >> testNum; cin.getline(temp, 255); for(i=0; i=65 && testlist[i][j]<=90) testlist[i][j] = testlist[i][j] + 32; } } calculate(); if(testcase!=0) cout << endl; } return 0; } }}}