help!
查看原帖
help!
1057768
ycx20120224楼主2023/8/29 15:52
#include<iostream>
using namespace std;
long long a[40005]={0};
int main(void)
{
    long long n,h=0,w=0;
    cin>>n;
    for(;cin>>a[i];w++)
    {
    	cin>>a[i];
	}
    for(int i=0;i<w;i++)
    {
    	if(i%2==0)
    	{
    		for(int j=0;j<a[i];j++)
 		    {
    			cout<<0;
    			h++;
    			if(h>=n)
    			{
    				cout<<endl;
    				h=0;
				}
    		}
		}
		else
    	{
    		for(int j=0;j<a[i];j++)
 		    {
    			cout<<1;
    			h++;
    			if(h>=n)
    			{
    				cout<<endl;
    				h=0;
				}
    		}
		}
	}
	return 0;
}

怎么办?

2023/8/29 15:52
加载中...