Liuzhenyuan @ 2023-07-13 19:24:35
#include<iostream>
using namespace std;
int main()
{
int n,x,flag=0,s=0;
cin>>n;
for(int i=1;i<=n;)
{
cin>>x;
for(int j=1;j<=x;j++)
{
cout<<flag;
s++;
if(s%7==0)
{
cout<<endl;
i++;
}
}
flag=!flag;
}
return 0;
}
by Muh_Yih @ 2023-07-13 19:30:18
第14行,s%7==0
改为s%n==0
即可
AC 记录
by Rosaya @ 2023-07-13 19:31:55
输出的是
by Liuzhenyuan @ 2023-07-21 08:44:10
谢谢,已过