第六节 练习5
程序员文章站
2022-04-04 11:05:53
...
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
using namespace std;
#define PI 3.14
int main()
{
double x1,x2,y1,y2,s;
cout << "输入:";
scanf("(%lf,%lf)(%lf,%lf)",&x1,&y1,&x2,&y2); //利用scanf格式统一性
//scnaf ①格式一致 ②遇空则止 => 格式化中不要有空格!!
s = sqrt((x1-x2) * (x1-x2) + (y1-y2) * (y1-y2));
cout << s;
return 0;
}