跟你沟通 @ 2020-02-04 13:17:00
#include <bits/stdc++.h>
#define N 300
using namespace std;
int a[N];
int read()
{
char c;int sum=0;
for(int i=0;;++i)
{
while((c=getchar())!='\n' && c!=' ')
{
a[i]=a[i]*10+(c-'0');
}++sum;
if(c=='\n')
return sum;
}
}
int main()
{
int n,sum=0;cin>>n;getchar();
int s=read();
for(int i=0;i<s;i+=2)
{
for(int j=0;j<a[i];++j)
{
if(sum==n)
{ printf("\n");sum=0;}
printf("0");
++sum;
}
if(a[i+1]<s)
for(int j=0;j<a[i+1];++j)
{
if(sum==n)
{ printf("\n");sum=0;}
printf("1");
++sum;
}
}
return 0;
}
by Ryo_Yamada @ 2020-02-04 13:17:32
孩子语文不行a
by 跟你沟通 @ 2020-02-06 00:05:26
@breeze末影 ???