wzh2338 @ 2021-11-26 01:10:29
编译运行和示例是一样的,但是提交之后全是WA,请问大佬们这是为啥??qwq
#include<iostream>
#define inf 400
using namespace std;
int main()
{
int ch[inf];
int i = 1;
int max = 0;
int sum = 0;
int flag = 0;
cin >> ch[0];
if (ch[0] < 3 || ch[0]>200) return 0;
max = ch[0] * ch[0];
do {
cin >> ch[i];
sum += ch[i];
i++;
} while (max > sum);
for (i = 1;; i++)
{
for (sum = ch[i]; sum > 0; sum--)
{
if (i % 2 != 0)
cout <<0;
else
cout <<1;
if (++flag % 7 == 0)
cout << endl;
if (flag == max)
return 0;
}
}
}
by ud2_ @ 2021-11-26 01:22:20
如果 N 不等于 7 呢?
by wzh2338 @ 2021-11-27 23:58:47
@ud2_ 已经改过来了 我太笨啦哈哈哈哈
by wzh2338 @ 2021-11-27 23:59:10
已经改好了,100%通过嘿嘿