HzuWHF


私信TA

用户名:I7I08I9047

访问量:76403

签 名:

我RUN了

等  级
排  名 18
经  验 20453
参赛次数 13
文章发表 127
年  龄 3
在职情况 学生
学  校 贺州学院
专  业

  自我简介:

解题思路:

        瞎写

参考代码:

#include<bits/stdc++.h>
#define Inf 0x3F3F3F3F
#define Loc freopen("baka.in", "r", stdin)
typedef long long LL;
using namespace std;

int Arr[9][12] = {
	{ 0 },
	{ 0, 4, 9, 2, 3, 5, 7, 8, 1, 6 },
	{ 0, 2, 9, 4, 7, 5, 3, 6, 1, 8 },
	{ 0, 8, 1, 6, 3, 5, 7, 4, 9, 2 },
	{ 0, 6, 7, 2, 1, 5, 9, 8, 3, 4 },
	{ 0, 4, 3, 8, 9, 5, 1, 2, 7, 6 },
	{ 0, 8, 3, 4, 1, 5, 9, 6, 7, 2 },
	{ 0, 6, 1, 8, 7, 5, 3, 2, 9, 4 },
	{ 0, 2, 7, 6, 9, 5, 1, 4, 3, 8 },
};
const int SIZE = 9;

int main() {
	vector<int> vec; vec.push_back(Inf);
	for (int pos = 1, Tmp; pos <= 9; pos++)
		cin >> Tmp, vec.push_back(Tmp);
	int Ind = 0, cnt = 0;
	for (int pos = 1; pos <= 9; pos++) {
		int M;
		for (M = 1; M < vec.size(); M++) {
			if (vec[M] == 0) continue;
			if (vec[M] != Arr[pos][M]) 
				break;
		}
		if (M == vec.size())
			Ind = pos, cnt++;
	}
	if (cnt > 1 || cnt == 0)
		puts("Too Many");
	else
		for (int pos = 1; pos <= 9; pos++) {
			cout << Arr[Ind][pos] << ' ';
			if (pos % 3 == 0) puts("");
		}
}


 

0.0分

4 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区