View Code of Problem 67

#include <stdio.h>
int main()
{
	int x[4], y[4], i, a, b, c, d;
	double s1, s2;
	while (scanf("%d%d", &x[0], &y[0])!=EOF)
	{
		for (i = 1; i < 4; i++)
		{
			scanf("%d%d", &x[i], &y[i]);
		}
		a = x[0] - x[1];
		b = y[0] - y[1];
		c = x[2] - x[3];
		d = y[2] - y[3];
		s1 = a / c*1.0;
		s2 = b / d*1.0;
		if (s1 == s2)
			printf("Yes\n");
		else
		{
			if (a*d == b*c)
				printf("No\n");
			else
				printf("Yes\n");
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 67