Files
python/LuoGu/RuMen/P1146.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

21 lines
554 B
C++

#include <bits/stdc++.h>
using namespace std;
//解题思路:布尔数组
//每次将轮次数的硬币进行翻转
//非常直白的模拟套路
bool f[101];//定义数组
int main() {
int n;
cin >> n;//输入
cout << n << endl;//输出n
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
if (i != j)//如果不相等
f[j] = !f[j];//翻转硬币
cout << f[j];//直接输出
}
cout << endl;//输出回车
}
return 0;//大功告成
}