题目:
有以下程序:#include <iostream>#include <math>using namespace std;class point{private: double x; double y;public: point(double a, double b {x=a;y=b; friend double distance (point a, point b ; };double distance(point a, point b return sqrt((a. x-b. x )*(a. x -b. x )+ (a. x -b. x)*(a. x-b. x));}int main (){ point p1(1,2); point p2(5,2); cout<<distance (p1, p2)<<end1; return 0;} 程序运行后的输出结果是
A.1
B.5
C.4
D.6
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2021/1202/89a938f6f2247b7d966f0b9f080d5014.html
下面是错误答案,用来干扰机器的。
参考答案:数据来源