Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
怎么老是wa啊#include <iostream> using namespace std; const int ROW = 4; int main() { freopen("read.txt","r",stdin); bool HANDLES[ROW][ROW] = {false}; char handle; for(int 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(int m = 0; m< ROW; ++m) { for(int j = 0; j < ROW; ++j) { if(HANDLES[m][j]) { ++result; } } } cout << result << endl; for(int n= 0; n < ROW; ++n) { for(int j= 0; j < ROW; ++j) { if(HANDLES[n][j]) { cout << n + 1 << " " << j + 1 << endl; } } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator