fork download
  1. void zapoln(HDC hdc, Poin points[], int numb, Data data, Point rebr[]) {
  2. HBRUSH redBrush = CreateSolidBrush(RGB(255, 0, 0)); // Выбираем красную кисть
  3. SelectBrush(hdc, redBrush);
  4. int min = 0, max = 0, x1, x2,i;
  5. Point p;
  6. // ищем максимальный и минимальный y
  7. for (int i = 0; i < numb; i++) {
  8. if (min > points[i].y)
  9. min = points[i].y;
  10. if (max < points[i].y) {
  11. max = points[i].y;
  12. }
  13. }
  14. while (max > min) {
  15. for (i = 0; i < numb; i++) {
  16. if (rebr[i].y1 < max && rebr[i].y2 >= max)
  17. x1 = (max - rebr[i].y1)*(float)abs(rebr[i].x1 - rebr[i].x2) / abs(rebr[i].y1 - rebr[i].y2) + rebr[i].x1;
  18. if (rebr[i].y2 < max && rebr[i].y1 >= max)
  19. x2 = (max - rebr[i].y2)*(float)abs(rebr[i].x1 - rebr[i].x2) / abs(rebr[i].y1 - rebr[i].y2) + rebr[i].x2;
  20.  
  21. }
  22. Point p;
  23. p.x1 = x1;
  24. p.x2 = x2;
  25. p.y1 = max;
  26. p.y2 = max;
  27. line(p, &hdc, data);
  28. max--;
  29.  
  30. }
  31. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:13: error: variable or field ‘zapoln’ declared void
 void zapoln(HDC hdc, Poin points[], int numb, Data data, Point rebr[]) {
             ^~~
prog.cpp:1:13: error: ‘HDC’ was not declared in this scope
prog.cpp:1:22: error: ‘Poin’ was not declared in this scope
 void zapoln(HDC hdc, Poin points[], int numb, Data data, Point rebr[]) {
                      ^~~~
prog.cpp:1:37: error: expected primary-expression before ‘int’
 void zapoln(HDC hdc, Poin points[], int numb, Data data, Point rebr[]) {
                                     ^~~
prog.cpp:1:47: error: ‘Data’ was not declared in this scope
 void zapoln(HDC hdc, Poin points[], int numb, Data data, Point rebr[]) {
                                               ^~~~
prog.cpp:1:58: error: ‘Point’ was not declared in this scope
 void zapoln(HDC hdc, Poin points[], int numb, Data data, Point rebr[]) {
                                                          ^~~~~
stdout
Standard output is empty