为什么测试是对的,提交全WA
查看原帖
为什么测试是对的,提交全WA
764268
TD21260225楼主2022/9/21 20:57
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(){
    int num,temp=0;
    int arr[100];
    int N ,W;
    cin>>N>>W;
    int array[N][N];
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            if(num== W){
                num=0;
                cin>>W;
                if(temp==1){
                    temp=0;
                }else{
                    temp =1;
                }
            }
            array[i][j]=temp;
            num++;
        }
    }
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            cout <<array[i][j];
        }
        cout << endl;
    }
}
2022/9/21 20:57
加载中...