#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
using namespace std;
int main(int argc, char** argv)
{
int box[9][9];
while(scanf("%d", &box[0][0]) != EOF)
{
for(int i = 0;i < 9;i++)
{
for(int j = 0;j < 9;j++)
{
if(i+j == 0) continue;
scanf("%d", &box[i][j]);
}
}
bool YON = true;
for(int i = 0;i < 9 && YON;i++)
{
bool check_1[9];
bool check_2[9];
bool check_3[9];
for(int j = 0;j < 9 && YON;j++)
{
check_2[box[i][j]-1] = true;
check_1[box[j][i]-1] = true;
int gx = i%3, gy = i/3;
check_3[box[gx*3+j%3][gy*3+j/3]-1] = true;
//cout << gx*3+j%3 << ":" << gy*3+j/3 << endl;
}
for(int j = 0;j < 9 && YON;j++)
{
if(check_3[j] == false)
YON = false;
if(check_2[j] == false)
YON = false;
if(check_1[j] == false)
YON = false;
}
}
if(YON)
{
cout << "yes" << endl;
}
else
{
cout << "no" << endl;
}
//scanf("");
}
return 0;
}
自己測的第一個測資是no 但送出後line1 說他是 yes就錯了