Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

怎么老是wa啊

Posted by neu_swc at 2009-08-09 00:25:03 on Problem 2965
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator