C++如何从.lnk文件中提取连接路径
- 提问者网友:记得曾经
- 2021-03-05 01:00
- 五星知识达人网友:夜风逐马
- 2021-03-05 01:51
有三种方法解决
1、重装系统,再装编译器
2、再装编译器,但是路径和之前装的编译器路径相同
3、修改现在装好的编译器的设置
建议选第二种方法,因为3 很麻烦
- 1楼网友:独钓一江月
- 2021-03-05 03:02
您好,我是软件之家的♂北极熊熊,很高兴为您解答。 ================================================================================== 正确代码如下: #include "iostream.h" #include "math.h" class point { public: point(int xx=0,int yy=0) {x=xx;y=yy;} int getx() {return x;} int gety() {return y;} private: int x,y; };
class line { public: line(point xp1,point xp2); double getlen() {return len;} private: point p1,p2; double len; };
line::line(point xp1,point xp2) { p1=xp1;p2=xp2; double x=double(p1.getx()-p2.gety()); double y=double(p1.getx()-p2.gety()); len=sqrt(x*x+y*y); }
void main() { point a(1,1),b(3,3); line line(a,b); cout<<"线段长度是"<<line.getlen()<<endl; }
================================================================================== 如您满意,谢谢五星采纳~~~~~↖(*^ω^*)↗