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.

30 lines
1.1 KiB

2 years ago
#include <bits/stdc++.h>
using namespace std;
int n; //汉字点阵的长和宽
int nums; //输出1还是0呢默认是0
int m; //每次输入的值是几个
int K; //已经处理完的数字个数
int main() {
cin >> n;//几行几列本题示例是7
/*(1)数据的读入需要有终止的条件。因为我们不知道具体要输入多少个压缩码,
forwhile
n*nk<n*n
(2)k1m
*/
while (k < n * n) {
cin >> m;
for (int j = 1; j <= m; j++) {
printf("%d", num);
//数量,用于判断是否换行,另一个重要的作用是用来判断程序是否该结束了
k++;
//换行
if (k % n == 0) printf("\n");
}
//调整为相反数,为下一次做准备
num = !num;
}
return 0;
}