Cod sursa(job #2252530)

Utilizator denmirceaBrasoveanu Mircea denmircea Data 2 octombrie 2018 19:48:48
Problema Oras Scor 55
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.7 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin ("oras.in");
ofstream fout ("oras.out");
bool a[201][201];
int n,c,i,j;
int main()
{
    fin>>n;
    if(n%2==1)
    {
        c=3;
        a[1][2]=true;
        a[2][3]=1;
        a[3][1]=true;
        while(c<n)
        {
            c++;
            a[c+1][c]=true;
            for(i=1; i<c; i++)
            {
                a[c][i]=1;
                a[i][c+1]=true;
            }
            c++;
        }
    }
    else
    {
        c=4;
        fout<<-1;
        return 0;
    }
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n;j++)
            fout<<a[i][j];
        fout<<"\n";
    }
}