c++蒟蒻求助
查看原帖
c++蒟蒻求助
1105472
xyy_xxyy楼主2024/1/19 16:26

0分,全WA。。。

代码:

#include<bits/stdc++.h>
using namespace std;
int main() {
	int n;
	cin >> n;
	int x = 1;
	int a;
	int sum = 0;
	int f = 0;
	int cik = 0;
	while (x <= n * n) {
		cin >> a;
		for (int i = 1; i <= a; i++) {
			cout << f;
			cik++;
			if (cik % n	 == 0) {
				cout << "\n";
			}
		}
		f = !f;
		x++;
	}
	return 0;
}
2024/1/19 16:26
加载中...