You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
534 B
21 lines
534 B
#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;//大功告成
|
|
} |