fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int x1, y1, x2, y2, x3, y3, x4, y4;
  7.  
  8. cin >> x1 >> y1
  9. >> x2 >> y2
  10. >> x3 >> y3
  11. >> x4 >> y4;
  12.  
  13. if (x1 == x2 || x3 == x4)
  14. {
  15. cout << "YES!";
  16. }
  17. else
  18. {
  19. double M1 = (double)(y2 - y1) / (x2 - x1);
  20. double M2 = (double)(y4 - y3) / (x4 - x3);
  21.  
  22. if (M1 != M2)
  23. {
  24. cout << "YES!";
  25. }
  26. else
  27. {
  28. cout << "NO";
  29. }
  30. }
  31.  
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
YES!