#include <stdio.h>#ifndef __min#define __min(a, b) ((a)<(b)? (a):(b))#endif#ifndef __max#define __max(a, b) ((a)>(b)? (a):(b))#endiftypedef struct _tagPOINT{ char x; char y;} POINT;POINT pts[90];int pts_top; int Direction(int xi, int yi, int xj, int yj, int xk, int yk){ return (xk-xi)*(yj-yi) - (xj-xi)*(yk-yi);}int main(int argc, char* argv[]){ int x0, y0, x1, y1, x2, y2, x, y; int left, top, right, bottom; int min_x, i, j, cur_y; printf("Program 4 by team Xn"); while(scanf("%d %d %d %d %d %d", &x0, &y0, &x1, &y1, &x2, &y2) != EOF) { pts_top = -1; min_x = 10; left = __min(__min(x0, x1), x2); top = __max(__max(y0, y1), y2); right = __max(__max(x0, x1), x2); bottom = __min(__min(y0, y1), y2); for(y = top; y >= bottom; y--) { for(x = left; x <= right; x++) { if( Direction(x0, y0, x1, y1, x, y) <= 0) continue; if( Direction(x1, y1, x2, y2, x, y) <= 0) continue; if( Direction(x2, y2, x0, y0, x, y) <= 0) continue; ++pts_top; pts[pts_top].x = x; pts[pts_top].y = y; if(x < min_x) min_x = x; } } cur_y = -10; for(i = 0; i <= pts_top; i++) { if(pts[i].y != cur_y) { cur_y = pts[i].y; if(i > 0) printf("n"); for(j = 0; j < ( pts[i].x - min_x ) * 9; j++) printf(" "); } else { if(i > 0) printf(" "); } printf("(%2d, %2d)", pts[i].x, pts[i].y); } printf("nn"); } printf("End of program 4 by team Xn"); return 0;}