Hazehacker @ 2024-12-07 11:36:03
#include<iostream>
#include<vector>
using namespace std;
int main() {
int n;
cin >> n;
int a,cnt =0;
vector<int> v;
while (cin >> a) {
v.push_back(a);
}
for (int i = 0; i < v.size(); ++i) {
for (int j = 0; j < v[i]; ++j) {
if ((i + 1) % 2 != 0) {
cout << 0;
}
else {
cout << 1;
}
cnt++;
if (cnt % 7 == 0) {
cout << "\n";
}
}
}
}
by cupWolf @ 2024-12-07 11:51:50
设某汉字由
N \times N 的\texttt 0 和\texttt 1 的点阵图案组成。
不是每行
将 cnt % 7 == 0
改为 cnt % n == 0
即可