典中典之linux读不进
查看原帖
典中典之linux读不进
500888
sodiums楼主2021/4/13 10:51
#include <iostream>
using namespace std;
int main ()
{
    int n;
    cin >> n;
    int code[100];
    for (int i=0;i<100;i++) code[i]=0;
    int i=0;
    for (int v1,tmp=0;v1<n*n;i++)
    {
        cin >>tmp;
        v1+=tmp;
        code[i]=tmp;
        
    }// i-1 尾
    int ps=0;
    int max=n;
    int now=1;
    for (int p=0;p<i;p++)
    {
        for (int x=0;x<code[p];x++)
        {
            cout << ps;
            now++;
            if (now == max+1)
            {
                cout <<endl;
                now=1;
            }
        }
        if (ps==0)
        {
            ps=1;
        }
        else
        {
            ps=0;
        }
    }
    return 0;
}

windows运行正常 求救,如何才能让洛谷知道我的心意

2021/4/13 10:51
加载中...