错了
查看原帖
错了
349906
封禁用户楼主2020/7/2 20:33
#include<iostream>
using namespace std;
int main()
{
    int a,temp,k=0;
    bool iz=false;
    int mp[a*a+1];
    cin>>a;
    while(cin>>temp)
    {
        for(int i=0;i<temp;i++)
        {
            if(iz)mp[i+k]=1;
            else mp[i+k]=0;
        }
        iz=!iz;
        k+=temp;
    }
    int cnt=0;
    for(int i=0;i<a;i++)
    {
        for(int j=0;j<a;j++)
        {
            cout<<mp[cnt++];
        }
        cout<<endl;
    }
}

2020/7/2 20:33
加载中...