ADD file via upload

main
pfjlev589 1 year ago
parent 3cf5ccd1b7
commit 4900da6ac0

49
2.txt

@ -0,0 +1,49 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int a[9][9] = { 0 };
int i, j, k;
srand(time(NULL));
printf("|-------------------|\n");
for (i = 0; i < 9; i++)
{
for (j = 0; j < 9; j++)
{
if (j % 3 == 0)
printf("|");
if (rand() % 3 == 0)
{
do
{
k = rand() % 9 + 1;
} while (a[i][k - 1] != 0);
a[i][k - 1] = k;
printf("%d", k);
}
else
{
a[i][j] = 0;
printf(".");
}
if (j == 8)
printf("|");
printf(" ");
}
printf("\n");
if ((i + 1) % 3 == 0)
printf("|-------------------|\n");
}
return 0;
}
Loading…
Cancel
Save