#include <bits/stdc++.h> using namespace std; int a[1000][1000]; int main() { int x1,y1,x2,y2; int x3,y3,x4,y4; while(cin>>x1>>y1>>x2>>y2) { cin>>x3>>y3>>x4>>y4; int a1,b1,a2,b2; a1 = (x1-x2)*(y3-y4); a2 = (x3-x4)*(y1-y2); //判断两条直线是否重合 b1=(y3-y1)*(x2-x1); b2=(x3-x1)*(y2-y1); if(a1==a2&&b1!=b2) cout<<"No"<<endl; else cout<<"Yes"<<endl; } return 0; } |
Double click to view unformatted code.