下列程序对加号进行了重载,划线部分的语句是______。
include<iostream.h>
include<math.h>
class Triangle
{
int x,y,z;
double area;
public:
Triangle(int i,int j,int k)
{
double s;
x=i;y=j;z=k;
s=(x+y+z)/2.0;
area=sqrt(s*(s-x)*(s-y)*(s-z));
}
void disparea( )
{
cout<<"Area="<<area<<endl;
}
friend double operator+(Triangle tl,Triangle t2)
{
______
}
};
void main( )
{
Triangle tl(3,4,5),t2(5,12,13);
double s;
cout<<"tl:";t1. disparea( );
cout<<"t2:";t2. disparea( );
s=t1+t2:
cout<<"总面积:="<<s<<endl;
}
第1题:
在C程序中如果要使用数学函数,如sqrt(x),pow(x,y)等,需要在程序中加入的语句是______
A.#define <math.h>
B.#define <stdio.h>
C.#include <stdio.h>
D.#include <math.h>
第2题:
2、在C程序中如果要使用数学函数,如sin(x),log(x)等,需要在程序中加入的语句是
A.#include <math.h>
B.#include <stdio.h>
C.#define <math.h>
D.#define <stdio.h>
第3题:
在C程序中如果要使用数学函数,如sin(x),log(x)等,需要在程序中加入的语句是________。
A.#include <math.h>
B.#include <stdio.h>
C.#define <math.h>
D.#define <stdio.h>
第4题:
16、在C程序中如果要使用数学函数,如sin(x),log(x)等,需要在程序中加入的语句是
A.#include <math.h>
B.#include <stdio.h>
C.#define <math.h>
D.#define <stdio.h>
第5题:
在C程序中如果要使用数学函数,如sin(x),log(x)等,需要在程序中加入的语句是()
A.#include <stdio.h>
B.#define <stdio.h>
C.#include <math.h>
D.#define <math.h>