-+ ----------- + --
To flip a position, you must flip all the other pawns in the row and column.
The method to flip a position without changing other positions: the row and column where the position is located have a total of 7 flip faces. After knowing this method, you can skip this question.
OnlineCodeIn particular:
# Include <iostream> Using Namespace STD; Const Int Row = 4; Int Main (){ // Freopen ("D:/t.txt", "r", stdin ); Bool Handles [row] [row] = { False }; Char Handle;Int I; For (I = 0; I <row; ++ I ){ For ( Int J = 0; j <row; ++ J) {CIN> handle; If (Handle = '+') {handles [I] [J] =! Handles [I] [J]; For ( Int K = 0; k <row; ++ K) {handles [I] [k] =! Handles [I] [k]; handles [k] [J] =! Handles [k] [J] ;}}} Int Result = 0;For (I = 0; I <row; ++ I ){ For ( Int J = 0; j <row; ++ J ){ If (Handles [I] [J]) {++ result ;}}} cout <result <Endl; For (I = 0; I <row; ++ I ){ For ( Int J = 0; j <row; ++ J ){ If (Handles [I] [J]) {cout <I + 1 <" "<J + 1 <Endl ;}}} Return 0 ;}