#include #include using namespace std; int main() { int n,temp,f=0,i,m=0; int x[3],y[3]; bool bor[100][100][4]; for(i=0;i<100;i++) for (int j=0;j<100;j++) for (int k=0;k<4;k++) bor[i][j][k]=false; ifstream fin; fin.open("test.txt"); if (!fin.is_open()) { cerr << "There is an error in finding the file!"; return 1; } ofstream fout; fout.open("test2.txt"); fin >> n; while (n!=0) { for(i=0;i<100;i++) for (int j=0;j<100;j++) for (int k=0;k<4;k++) bor[i][j][k]=false; for (int u=0;u> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2]; x[0]+=50; x[1]+=50; x[2]+=50; y[0]+=50; y[1]+=50; y[2]+=50; if (x[1]==x[2]) { temp=x[0]; x[0]=x[2]; x[2]=temp; temp=y[0]; y[0]=y[2]; y[2]=temp; } if (x[0]==x[2]) { temp=x[1]; x[1]=x[2]; x[2]=temp; temp=y[1]; y[1]=y[2]; y[2]=temp; } if(y[1]>y[0]) { temp=x[0]; x[0]=x[1]; x[1]=temp; temp=y[0]; y[0]=y[1]; y[1]=temp; } if (y[0] == y[2]) { if (x[0] > x[2]) { m=x[1]; i=y[1]; while (m>x[2] && im;j--) { bor[j-1][i][0]=true; bor[j-1][i][3]=true; bor[j-1][i][1]=true; bor[j-1][i][2]=true; } bor[m-1][i][2]=true; bor[m-1][i][3]=true; m--; i++; } } else { m=x[1]; i=y[1]; while (m x[2]) { m=x[2]; i=y[1]; while (mm+1;j--) { bor[j-1][i][0]=true; bor[j-1][i][3]=true; bor[j-1][i][1]=true; bor[j-1][i][2]=true; } bor[m][i][2]=true; bor[m][i][1]=true; m++; i++; } } else { m=x[2]; i=y[1]; while (m>x[1] && i>n; } return 0; }