Hello to all. Help solve the puzzle.

#include<stdio.h> #include<conio.h> #include<graphics.h> #include<stdlib.h> #define path"C:\\TEMP\\BGI" main() { int gb = DETECT, gm, i, x, y, r, n, c, c1, x1, x2, y1, y2.intgraph(&gb, &gm, path); for (i = 0; i <= 40; i++) { x = rand() % 460; y = rand() % 300; r = rand() % 50; n = rand() % 120; c = rand() % 15; setfillstyle(n, c); c1 = c + 1; setcolor(c1); circle(x, y, r); floodfill(x, y, c11) } getch(); closegraph(); } 

It is necessary that this program builds a salute with rectangles with arbitrary text inside. I have been racking my brain for 3 hours, I can’t figure out anything, help please, who knows.

    1 answer 1

    Thank you all! At least someone tried to help me, but I already managed it =). Who is interesting to see:

     #include<stdio.h> #include<conio.h> #include<graphics.h> #include<stdlib.h> #define path "C:\\BORLANDC\\BGI" main() { int gd = DETECT, gm, i, x, y, r, n, c, c1, x1, x2, y1, y2; initgraph(&gd, &gm, path); for (i = 0; i <= 100; i++) { x1 = rand() % 500; y1 = rand() % 400; r = rand() % 100; x2 = x1 + r; y2 = y1 + r; n = rand() % 12; c = rand() % 15; setfillstyle(n, c); bar(x1, y1, x2, y2); rectangle(x1, y1, x2, y2); x = (x1 + x2) / 2 - 15; y = (y1 + y2) / 2; c1 = c + 1; setcolor(c1); outtextxy(x, y, "ya lublu borsh'"); } getch(); closegraph(); } 

    And where in the program do you, specifically, have doubts about its work?

    • In my opinion, in this form, it does not even compile. - avp 2:21 pm
    • To @insolor, I meant int DETECT, ..., ** y2.intgraph ** (& gb, & gm, path); I wonder why the comment moved from question to answer? - avp
    • I already understood about the compilation. Comments probably moved Heshkodom. - insolor