yicu @ 2021-08-20 21:59:02
#include<iostream>
using namespace std;
int main() {
int n, s, count = 1;
cin >> n;
int f = -1;
const char* a;
for (int i = 0; i < n * n; i += s) {
cin >> s;
for (int j = 0; j < s; j++)
{
a = f==1 ? "1 " : "0 ";
cout << a;
if (count % n == 0)
cout << endl;
count++;
}
f *= -1;
}
}
by Micfongg @ 2021-09-17 21:06:54
1
和0
之间不用输出空格