# include stdafx include math include windowsx include AtlConv include c

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156``` ```#include "stdafx.h" #include #include #include #include struct _points{int x,y;}; //Четыре точки трапеции //Считывание данных void scanpoints(FILE *fp,_points *points) { int point_x=0,point_y=0; for(int i=0;fscanf(fp,"%d,%d",&point_x,&point_y)!=EOF&&i<8;i++) { points[i].x=point_x; points[i].y=point_y; } } int parallel(_points p_1,_points p_2,_points p_3,_points p_4) { float k_1=0.,k_2=0.; //Угловой коэффициент прямой проходящей через p_1 и p_2 bool result; k_1=(float)(p_2.y-p_1.y)/(p_2.x-p_1.x); k_2=(float)(p_4.y-p_3.y)/(p_4.x-p_3.x); if(abs(k_1)==abs(k_2)) result=true; else result=false; return result; } int inwindow(RECT size,_points *points) { bool result=true; int i; for(i=0;i<4;i++) if(!(points[i].x>size.left&&points[i].xsize.top&&points[i].ypoints[0].x&& points[4].y>points[0].y&& points[5].xpoints[1].y&& points[6].xpoints[3].x&& points[7].y