This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

21
LuoGu/RuMen/P1146.cpp Normal file
View File

@@ -0,0 +1,21 @@
#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;//大功告成
}