0分

P1319 压缩技术

lizishi @ 2024-07-07 17:08:01

#include <iostream>
using namespace std;
#define len 200
int a[len*len]={0};
int main()
{
    int n;
    int sum;
    int cnt=0;
    bool next;
    int count=0;
    cin>>n;
    for(int i=0;i<len*len;i++)
    {
        cin>>a[i];
        cnt++;
    }
    for(int i=0;i<cnt;i++)
    {
        for(int j=1;j<=a[i];j++)
        {
            cout << (int)next;
            count++;
            if(count==n)
            {
                count=0;
                cout << endl;
            }
        }
        next=!next;
    }
    return 0;
}

by zxz114514 @ 2024-07-17 19:34:31

@lizishi


|