题目来源:码蹄集
https://matiji.net/exam/brushquestion/178/778/B3FCFEC101BD05189BB74D522E019504
参考程序:
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
using namespace std;
#define N 1000
#define ll long long
int x[10],y[10] ,a,b;
int main(){
scanf("(%d,%d) (%d,%d)\n",&x[1],&y[1],&x[2],&y[2]);
scanf("(%d,%d)",&a,&b);
double ans = sqrt(pow((x[1]-x[2]),2.0) + pow((y[1]-y[2]),2.0));
double ans1 = sqrt(pow((a-x[2]),2.0) + pow((b-y[2]),2.0));
double ans2 = sqrt(pow((x[1]-a),2.0) + pow((y[1]-b),2.0));
if (ans == ans1 +ans2){
cout << "YES" ;
}
else cout <<"NO";
return 0;
}
/*
(-20,20) (20,20)
(30,20)
*/