Cod sursa(job #84903)

Utilizator DastasIonescu Vlad Dastas Data 18 septembrie 2007 13:11:15
Problema Oras Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 kb
#include <cstdio>

const int maxn = 202;

FILE *in = fopen("oras.in","r"), *out = fopen("oras.out","w");

int n;
char a[maxn][maxn];

int main()
{
    fscanf(in, "%d", &n);
    if ( n == 4 )
    {
        fprintf(out, "%d\n", -1);
        return 0;
    }

    for ( int i = 1; i <= n - 2; ++i )
        a[i][n-1] = '1', a[n][i] = '1';
    a[n-1][n] = '1';

    for ( int i = 1; i <= n; ++i )
    {
        for ( int j = 1; j <= n; ++j )
            fprintf(out, "%c", a[i][j] == '1' ? '1' : '0');
        fprintf(out, "\n");
    }


	return 0;
}