|
|
вернуться в форумWhy Wa !? #include <iostream> using namespace std; const int n = 8; int LD[2*(n+2)]; // left diagonal int RD[2*(n+2)]; // right diagonal int row[n+1]; // the row int main() { int i; int x,y; char c; memset(LD,0,sizeof LD); memset(RD,0,sizeof RD); memset(row,0,sizeof row); for(i=0;i<32;i++) { cin >> c >> y; x = c-'a'+1; // if(!LD[n-x+y] && !RD[x+y] && !row[y]) { // checks LD[n-x+y] = RD[x+y] = row[y] = 1; } else { cout << i+1 << endl; // one can hit other cin >> c; return 0; } } cout << "Draw" << endl; // is this case possible ? return 0; } |
|
|