Pagini recente » Profil robertpoe | Cod sursa (job #2703432) | Monitorul de evaluare | Stalpisori | Cod sursa (job #84906)
Cod sursa(job #84906)
#include <cstdio>
const int maxn = 202;
FILE *in = fopen("oras.in","r"), *out = fopen("oras.out","w");
int n;
int 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; ++i )
for ( int j = 1; j <= n; ++j )
a[i][j] = 0;
for ( int i = 1; i <= n - 2; ++i )
a[i][n-1] = 1, a[n][i] = 1;
a[n-1][n] = 1, a[n][n-1] = 1;
for ( int i = 1; i <= n; ++i )
{
for ( int j = 1; j <= n; ++j )
fprintf(out, "%d", a[i][j]);
fprintf(out, "\n");
}
return 0;
}