Код
void main()
{
clrscr();
int x1,y1,x2,y2,sp,xmin,xmax,ymin,ymax;
float kx,ky;
cout<<"x1= "; cin>>x1;
cout<<"y1= "; cin>>y1;
cout<<"x2= "; cin>>x2;
cout<<"y2= "; cin>>y2;
sp=x1*y1+x2*y2;
if(sp==0) cout<<"Vektora perpend.";
else cout<<"Vertora ne perpend.";
cout<<"\n";
if(x1>=x2) {xmax=x1; xmin=x2;}
else {xmax=x2; xmin=x1;}
if(y1>=y2) {ymax=y1; ymin=y2;}
else {ymax=y2; ymin=y1;}
if(xmin!=0) kx=xmax/xmin;
if(ymin!=0) ky=ymax/ymin;
if(kx==ky) cout<<"Vektora kollinearnbl";
else cout<<"Vektora ne kollinearnbl";
getch();
}
{
clrscr();
int x1,y1,x2,y2,sp,xmin,xmax,ymin,ymax;
float kx,ky;
cout<<"x1= "; cin>>x1;
cout<<"y1= "; cin>>y1;
cout<<"x2= "; cin>>x2;
cout<<"y2= "; cin>>y2;
sp=x1*y1+x2*y2;
if(sp==0) cout<<"Vektora perpend.";
else cout<<"Vertora ne perpend.";
cout<<"\n";
if(x1>=x2) {xmax=x1; xmin=x2;}
else {xmax=x2; xmin=x1;}
if(y1>=y2) {ymax=y1; ymin=y2;}
else {ymax=y2; ymin=y1;}
if(xmin!=0) kx=xmax/xmin;
if(ymin!=0) ky=ymax/ymin;
if(kx==ky) cout<<"Vektora kollinearnbl";
else cout<<"Vektora ne kollinearnbl";
getch();
}