Pagini recente » Cod sursa (job #468511) | Cod sursa (job #2790886) | Cod sursa (job #3222722) | Cod sursa (job #468385) | Cod sursa (job #84903)
Cod sursa(job #84903)
#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;
}