View Code of Problem 67

#include<stdio.h>
int main()
{
	int x1,y1,x2,y2,x3,y3,x4,y4;
	while(scanf("%d%d%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4)!=EOF)
	{
		double s1,s2;
		if(x1!=x2&&x4!=x3)
		{
		  s1=(y2-y1)/(x2-x1);
		  s2=(y4-y3)/(x4-x3);
		  if(s1==s2)
		  printf("NO\n");
		  else
		  printf("YES\n");
	    }
	    else
	    {
	    	if(x2==x1&&3==x4)
	    	 printf("NO\n");
	    	 else
	    	printf("YES\n");	
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 67