求助 哪错了全wa
  • 板块P1319 压缩技术
  • 楼主yicu
  • 当前回复1
  • 已保存回复1
  • 发布时间2021/8/20 21:59
  • 上次更新2023/11/4 09:52:29
查看原帖
求助 哪错了全wa
557150
yicu楼主2021/8/20 21:59
#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;

	}

}

2021/8/20 21:59
加载中...