sodiums @ 2021-04-13 10:51:00
#include <iostream>
using namespace std;
int main ()
{
int n;
cin >> n;
int code[100];
for (int i=0;i<100;i++) code[i]=0;
int i=0;
for (int v1,tmp=0;v1<n*n;i++)
{
cin >>tmp;
v1+=tmp;
code[i]=tmp;
}// i-1 尾
int ps=0;
int max=n;
int now=1;
for (int p=0;p<i;p++)
{
for (int x=0;x<code[p];x++)
{
cout << ps;
now++;
if (now == max+1)
{
cout <<endl;
now=1;
}
}
if (ps==0)
{
ps=1;
}
else
{
ps=0;
}
}
return 0;
}
windows运行正常 求救,如何才能让洛谷知道我的心意
by sodiums @ 2021-04-13 10:55:19
我sb了,没把v1初始化
by JL_Lee @ 2021-04-13 12:57:40
紫衫谢谢