#include #include #include using namespace std;float perimetr(int x1,int y1, int x2, int y2, int x3, int y3){ float a,b,c; a=sqrt(float((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))); b=sqrt(float((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2))); c=sqrt(float((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3))); if(a>b+c || b>a+c || c>b+a) return 0; return a+b+c;}int main (){ int X[8]={1,6,3,8,4,1,8,3}; int Y[8]={2,4,1,7,9,3,5,8}; int i,j,k; int imax, jmax, kmax; float pmax=0,p=0; for(i=0;i<8;i++) { for(j=i+1;j<8;j++) { for(k=j+1;k<8;k++) { p=perimetr(X[i],Y[i],X[j],Y[j],X[k],Y[k]); if(pmax<p) { pmax=p; imax=i; jmax=j; kmax=k; } } } } if(pmax==0) cout<<"is etih tochek treugolnik sostavit nelzya!!!"; else { cout<<"tochka - "<<imax<<"\n"; cout<<"tochka - "<<jmax<<"\n"; cout<<"tochka - "<<kmax<<"\n"; } system ( " Pause " ); return 0;}