#include "stdafx.h"
#include "iostream.h"
#include "math.h"
float dis(int a, int b, int c,int d)
{
return (float)sqrt((a-c)*(a-c)+(b-d)*(b-d));
}
double dis(double a,double b,double c,double d)
{
return sqrt((a-c)*(a-c)+(b-d)*(b-d));
}
void main ()
{
cout<<"点(0,0)与点(3,4)的距离为:"<<dis(0,0,3,4)<<endl;
cout<<"点(11.2,-25)与点(0.33,11.22)的距离为:"<<dis(11.2,-25,0.33,11.22)<<endl;
}
梦里花落0921
慕森卡
随时随地看视频慕课网APP
相关分类