全wa求助
查看原帖
全wa求助
1068985
Hopoyage楼主2023/9/30 20:46
#include<iostream>
using namespace std;
int n,count = 0,temp,sum = 1;
int main(){
    cin >> n;
    while(sum <= n*n){
        cin >> temp;
        if(sum % 2 != 0){
            for(int i = 0;i < temp;i++){
                cout << 0;
                count++;
                if(count == n){cout << endl;count=0;}
            }
            sum++;
        }else
        if(sum % 2 == 0){
            for(int i = 0;i < temp;i++){
                cout << 1;
                count++;
                if(count == n){cout << endl;count=0;}
            }
            sum++;
        }
    }
    return 0;
}
2023/9/30 20:46
加载中...