#define _CRT_SECURE_NO_WARNINGS #include #include #include #include int randnumber(int a, int b) { return rand() % (b - a + 1) + a; } int genplocha(int a, int b, int c, int d) { for (int i = 0; i < b; i = i + 1) { printf("\n"); } for (int i = 0; i < a; i = i + 1) { if (i == c) { printf("X"); } else if (i==d) { printf("Y"); } else { printf("-"); } } printf("\n"); return 0; } int main() { int x, y; srand(time(0)); x=randnumber(0, 120); y = randnumber(0, 120); if (x == y) { if (y < 120) { y = y + 1; } else { y = y - 1; } } printf("%d\n", x); printf("%d\n",y); genplocha(120, 20, x, y); return 0; }