那几个测试数据都一样,但是都是显示WA
查看原帖
那几个测试数据都一样,但是都是显示WA
606774
apengya楼主2021/11/16 16:36
#include<iostream>
using namespace std;
int main()
{
	int n,c=0,a,b=0,d,e,f=0;
	cin >> n;
	for (int i = 1; b<=n*n ; i++)
	{
		cin >> a;
		c++;
		d = c % 2;
		
		for (int j = 1; j <= a; j++)
		{
			f++;
			e = f % n;
			if (d == 1) cout << 0;
			else cout << 1;
			if (e == 0) cout << endl;
		}
		b = a + b;
	}
	return 0;
}
2021/11/16 16:36
加载中...