preMd @ 2022-05-16 13:22:01
#include <iostream>
#include <cstdio>
using namespace std;
int main () {
int n , sum = 0 , flag = 0 , num , en;
cin >> n;
for ( ; sum < n * n ; ){
cin >> num;
flag ++;
for (int i = 0; i < num ; i ++){
if (en % n == 0 && en != 0) {
cout << endl;
en = 0;
}
if (flag % 2 != 0) cout << 0;
else cout << 1;
en ++;
sum ++;
}
}
return 0;
}
by int9 @ 2022-05-16 13:43:17
@preMd en
要初始化
by preMd @ 2022-05-16 17:11:13
@StarHorses 谢谢!听了你的建议之后AC了