#include<stdio.h> #include<iostream> #include<cstdlib> #include<cstdio> #include<cstring> #include<string> #include<algorithm> #include<vector> #include<cmath> #include<stack> #include<map> #include<vector> #include<cstdbool> using namespace std; int main() { double p[4]; double p2[4]; while (cin >> p[0] >> p[1] >> p[2] >> p[3]) { double x1; if ((p[2] - p[0]) != 0) { x1 = (p[3] - p[1]) / (p[2] - p[0]); } else { x1 = 0; } if (p[3] - p[1] == 0) { x1 = 500007; } cin >> p2[0] >> p2[1] >> p2[2] >> p2[3]; double x2; if ((p2[2] - p2[0]) != 0) { x2 = (p2[3] - p2[1]) / (p2[2] - p2[0]); } else { x2 = 0; } if (p2[3] - p2[1] == 0) { x2 = 500007; } int flag, flag2; flag = p[1] - x1 * p[0]; flag2= p2[1] - x2 * p2[0]; if (x1 == x2) { if(flag!=flag2){ cout << "No" << endl; } else { cout << "Yes" << endl; } } else { cout << "Yes" << endl; } } return 0; } |
Double click to view unformatted code.