#3339: 輸出超過測資的輸出!!(line:8)


superppp (我都想不到)


您的輸出超過測資的輸出!!(line:8)
您額外輸出了: no
 
請各位幫忙,我找不出錯誤的地方,謝謝~ 
 
#include <cstdlib>
#include <iostream>
#define level 9

using namespace std;

int compare(int , int [level][level]);

int main(void)
{
    int a[level][level];
    int temp, m;
    while(cin){
               for(int i=0; i<level; i++){
                   for(int j=0; j<level; j++)    cin >> a[i][j];
               }
               m=0;
               for(int i=0; i<level; i++){
                   if(m>0)    break;
                   for(int j=0; j<level; j++){
                       if(m>0)    break;
                       temp=a[i][j];
                       if(compare(temp, a)){
                           m++;
                           cout << "no" << endl;
                       }
                   }
               }
               if(!m)    cout << "yes" << endl;
    }
    return 0;
}

int compare(int x, int arr[level][level]){
    int count=0;
    for(int i=0; i<level; i+=3){
        for(int j=0; j<level; j+=3){
            count=0;
            for(int s=(i/3)*3; s<i+3; s++){
                for(int t=(j/3)*3; t<j+3; t++){    
                    if(arr[s][t]==x) count++;
                    if(count>1)    return 1;
                }
            }
        }
    }
    return 0;