View Code of Problem 67

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include<math.h>
void main() {
	int x1, y1, x2, y2, x3, y3, x4, y4;
	while(scanf("%d%d%d%d", &x1, &y1, &x2, &y2)!=EOF)
	{
		scanf("%d%d%d%d", &x3, &y3, &x4, &y4); 
		float k1, k2;
		k1 = (y2 - y1) / (x2 - x1);
		k2 = (y4 - y3) / (x4 - x3);
		if (k1 != k2) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
}

Double click to view unformatted code.


Back to problem 67