第一题:
#include
inline void printInfo(); //内联函数原型声明
void main()
{
printInfo(); //调用
}
第二题:
#include
#include
int calculateDistance(int x1,int y1,int x2,int y2)
//计算距离重载函数1
{
return (int)sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
double calculateDistance(double x1,double y1,double x2,double y2) //计算距离重载
函数1
{
return (double)sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
double calculateDistance(int x1,int y1,double x2,double y2) //计算
距离重载函数1
{
return (double)sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
void main()
{
cout