-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathL4_6.c
More file actions
36 lines (33 loc) · 850 Bytes
/
Copy pathL4_6.c
File metadata and controls
36 lines (33 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef struct tponto{
int x;
int y;
} tPonto;
typedef struct tpontos{
int x1;
int y1;
int x2;
int y2;
} tReta;
int main(){
int n, i = 1;
float distancia_inicio, distancia_fim, y_variacao;
tPonto ponto;
tReta reta;
scanf("%d", &n);
for ( i; i <= n; i++){
scanf("%d %d %d %d %d %d", &ponto.x, &ponto.y, &reta.x1, &reta.y1, &reta.x2, &reta.y2);
distancia_inicio = sqrt(((ponto.x-reta.x1)*(ponto.x-reta.x1))+((ponto.y-reta.y1)*(ponto.y-reta.y1)));
distancia_fim = sqrt(((ponto.x-reta.x2)*(ponto.x-reta.x2))+((ponto.y-reta.y2)*(ponto.y-reta.y2)));
if (distancia_inicio == distancia_fim) {
printf("EQUIDISTANTE\n");
}else if(distancia_inicio > distancia_fim) {
printf("FIM\n");
}else{
printf("INICIO\n");
}
}
return 0;
}