#include <stdio.h> int main(){ float x1,y1,x2,y2,x3,y3,x4,y4,k1,k2; while (scanf("%d%d%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4) != EOF){ if(x1==x2&&x2==x3&&x3==x4) printf("Yes"); else if((x1==x2)&&(x3==x4)) printf("No\n"); else if((x1==x2) ||(x3==x4)) printf("Yes\n"); else{ k1=(y2-y1)/((x2-x1)*1.0); k2=(y4-y3)/(x4-x3)*1.0); if(k1 == k2){ if(y1-x1*k1==y3-x3*k2) printf("Yes\n"); else printf("No\n"); } } } return 0; } /* Main.c: In function 'main': Main.c:4:3: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'float *' [-Wformat=] while (scanf("%d%d%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4) != EOF){ ^ Main.c:4:3: warning: format '%d' expects argument of type 'int *', but argument 3 has type 'float *' [-Wformat=] Main.c:4:3: warning: format '%d' expects argument of type 'int *', but argument 4 has type 'float *' [-Wformat=] Main.c:4:3: warning: format '%d' expects argument of type 'int *', but argument 5 has type 'float *' [-Wformat=] Main.c:4:3: warning: format '%d' expects argument of type 'int *', but argument 6 has type 'float *' [-Wformat=] Main.c:4:3: warning: format '%d' expects argument of type 'int *', but argument 7 has type 'float *' [-Wformat=] Main.c:4:3: warning: format '%d' expects argument of type 'int *', but argument 8 has type 'float *' [-Wformat=] Main.c:4:3: warning: format '%d' expects argument of type 'int *', but argument 9 has type 'float *' [-Wformat=] Main.c:13:28: error: expected ';' before ')' token k2=(y4-y3)/(x4-x3)*1.0); ^ Main.c:13:28: error: expected statement before ')' token */ |
Double click to view unformatted code.