1 条题解

  • 0
    @ 2025-4-6 15:02:52

    这题很水,只用注意输出回车和0与1的循环输出就行了,话不多说,直接上代码:

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int a,n,t=0,i=0,b,s=0;
    	cin>>n;
    	while(s<n*n){
    		cin>>a;
    		i++;
    		for(b=a;b>=1;b--){
    			if(t==n){
    				cout<<endl;
    				t=0;
    			}
    			if(i%2==1)
    				cout<<0;
                else 
    				cout<<1;
    			t++;
    			s++;
    		}
    	}
    	cout<<endl;
    	return 0;
    }
    

    信息

    ID
    97
    时间
    1000ms
    内存
    256MiB
    难度
    10
    标签
    递交数
    4
    已通过
    4
    上传者