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 |
为何不正确?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator