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

为何不正确?

Posted by jichong at 2007-05-10 21:52:29 on Problem 2361
#include <stdlib.h>3
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{ char a[3][3]; 
  int i,j,k,a1,b,N;
  i=0;
  scanf("%d",&N);
while(i<N)
  {a1=0;b=0;
  scanf("%s",&a[0]);
  for(k=0;k<3;k++)
     {for(j=0;j<3;j++)
    { if(a[k][j]=='O') 
      a1++;
     if(a[k][j]=='X') 
        b++;}}
  
     if(b-1==a1||a1==b)
      cout<<"YES"<<endl;
     else 
     cout<<"NO"<<endl; 
     cout<<endl;
     i++;
   }
    system("PAUSE");
    return EXIT_SUCCESS;
}

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