LiaFi1eNg
LiaFi1eNg
2017-12-07 16:56

C++[Error] ld returned 1 exit status

  • c++
  • 移动
  • namespace
  • ios
  • switch

#include
#include
using namespace std;
class Point
{
private:
int x,y;
public:
void yidondian();
void xianshijuli();
};
class Line
{
private:
int x,y;
public:
void diandaozhixianjuli();
void xielvguanxi();

};
class Friangle
{
private:
int x1,x2,x3,y1,y2,y3;
public:
void panduansanjiaoxing();
void jisuanmianji();

};
void Point::yidondian()
{
cout<<"输入移动点的坐标"< cin>>x>>y;
cout<<"移动点的坐标为:"<<"("<<x<<","<<y<<")";
}
void Point::xianshijuli()
{
int d;
d=sqrt(x*x+y+y);
cout<<"点到原点的距离为:"<<endl;

}
void Line::diandaozhixianjuli()
{
int a,b,c,d1,d2,d;
cout<<"输入点的坐标"< cin>>x>>y;
cout<<"输入直线ax±by+c=0的三个参数abc"< cin>>a>>b>>c;
d1=x*a+b*y+c;
d2=sqrt(a*a+b*b);
d=d1/d2;
if(d>0)
{

cout<<"点到直线的距离为:"< }
else if(d {
int d3;
d3=-d;
cout int k;
k=-(a/b);
if(b!=0)
{
cout }
else
cout }
}
void Line::xielvguanxi()
{
int a1,b1,c1,a2,b2,c2,w1,w2,w3;
cout cin>>a1>>b1>>c1;
cout<<"输入直线L2 a2x±b2y+c2=0的三个参数a2b2c2"< cin>>a2>>b2>>c2;
w1=a1*a2+b1*b2;
w2=a1/a2;
w3=b1/b2;
if(w1==0)
{
cout<<"两直线互相垂直";
}
else if((w2==w3)&&(w3!=c1/c2))
{
cout<<"两直线平行";
}
else if((w1==w2)&&(w2==w3))
{
cout<<"两直线重合";
}
else
cout<<"两直线相交且不垂直";
}

void Friangle::panduansanjiaoxing()
{
int x1,y1,x2,y2,x3,y3,d1,d2,d3,s1,s2,s3;
cout<<"依次输入三个点的坐标"< cin>>x1>>y1;
cin>>x2>>y2;
cin>>x3>>y3;
d1=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
d2=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
d3=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
s1=sqrt(d1*d1+d2*d2);
s2=sqrt(d1*d1+d3*d3);
s3=sqrt(d2*d2+d3*d3);
if(((d1+d2)>d3)&&((d1+d3)>d2)&&((d2+d3)>d1))
{
cout<<"能构成三角形"< if((d1==d2)&&(d2==d3))
{
cout }
if(d1==d2||d1==d3||d2==d3)
{
cout }
if(s1==d3||s2==d2||s3==d1)
{
cout }
double p;
p=(d1+d2+d3)/2;
double s;
s=sqrt(p*(p-d1)*(p-d2)*(p-d3));
cout }
else
{
cout }
}
void menu()
{
cout cout cout "< cout "< cout "< cout "< cout "<<endl;
cout<<"=============================="<<endl;
}
void hanshu1()
{
Point point1;
point1.yidondian();
point1.xianshijuli();

}
void hanshu2()
{
Line line1;
line1.diandaozhixianjuli();
line1.xielvguanxi();
}
void hanshu3()
{
Friangle friangle1;
friangle1.panduansanjiaoxing();
friangle1.jisuanmianji();

}
int main()
{
int i;
while(1)
{

 cin>>i;
 menu();
 switch(i)
 {
   case 1:  
            hanshu1();
            break;
   case 2:  
            hanshu2();
            break;
   case 3:  
            hanshu3();
            break;
   case 0:
            exit(0);
 }

}
return 0;
}

一直有这个问题运行不了。运行了又没有内容?

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答