'commit'
This commit is contained in:
21
LuoGu/RuMen/P1146.cpp
Normal file
21
LuoGu/RuMen/P1146.cpp
Normal 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;//大功告成
|
||||
}
|
||||
Reference in New Issue
Block a user