本文共 524 字,大约阅读时间需要 1 分钟。
把所有的 1 (或其他数字)换成另外的数字,就满足每行、每列、每块变更的数字的位置都不同。
#include#pragma warning(disable: 4996)typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint;typedef long long ll; typedef unsigned long long ull;using namespace std;char s[10];int main() { ios::sync_with_stdio(false); cin.tie(0); uint t; cin >> t; ++t; while (--t) { for (uint i = 0; i < 9; ++i) { cin >> s; for (uint j = 0; j < 9; ++j)if (s[j] == '1')s[j] = '2'; cout << s << '\n'; } } return 0;}
转载地址:http://zrtez.baihongyu.com/