Advertisement
themlgyo

Круги(не работает)

Dec 3rd, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.39 KB | None | 0 0
  1. // circstrc.cpp
  2. // графические объекты типа круг
  3. #include <msfotcon>
  4. #include <graphics>
  5. #include <windows.h>
  6. #include <stdio.h>
  7. #include <graphics>
  8. #include <conio>
  9. #include <stdlib>
  10. // для графических функций
  11. //////////////////////////////////////////////////////////
  12. struct circle                   // графический объект "круг"
  13. {
  14.     int xCo, yCo;                 // координаты центра
  15.     int radius;
  16.     color fillcolor;              // цвет
  17.     fstyle fillstyle;             // стиль заполнения
  18. };
  19. //////////////////////////////////////////////////////////
  20. void circ_draw(circle c)
  21. {
  22.     set_color(c.fillcolor);       // установка цвета
  23.     set_fill_style(c.fillstyle);  // установка стиля заполнения
  24.     draw_circle(c.xCo, c.yCo, c.radius); // рисование круга
  25. }
  26. //--------------------------------------------------------
  27. int main()
  28. {
  29.     init_graphics();              // инициализация графики
  30.     // создание кругов
  31.     circle c1 = { 15, 7, 5, cBLUE, X_FILL };
  32.     circle c2 = { 41, 12, 7, cRED, O_FILL };
  33.     circle c3 = { 65, 18, 4, cGREEN, MEDIUM_FILL };
  34.     circ_draw(c1);                // рисование кругов
  35.     circ_draw(c2);
  36.     circ_draw(c3);
  37.     set_cursor_pos(1, 25);        //cursor to lower left corner
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement