Pagini recente » Profil danbsaucvnush | Cod sursa (job #108575) | Cod sursa (job #179939) | aur | Cod sursa (job #200503)
Cod sursa(job #200503)
#include <stdio.h>
#include <algorithm>
#define mx 210
using namespace std;
long n;
long a[mx][mx];
int main()
{
freopen("oras.in","r",stdin);
freopen("oras.out","w",stdout);
scanf("%ld", &n);
for (int i = 1, x = 1; i <= n; i++, x = 1)
for (int j = i + 1; j <= n; j++)
{
a[i][j] = x;
a[j][i] = x ^ 1;
x ^= 1;
}
if (n == 4)
printf("-1\n");
else for (int i = 1; i <= n; i++)
{
if (!(n % 2))
{
a[3][6] = 0;
a[6][3] = 1;
}
for (int j = 1; j <= n; j++)
printf("%ld", a[i][j]);
printf("\n");
}
fclose(stdin);
fclose(stdout);
return 0;
}