#include <stdio.h>
#include <math.h>
typedef struct {
int x;
int y;
} ponto;
int quadradoPontos(int p1, int p2) {
}
void lePonto(char nome, char coordenada, ponto *p) {
printf("\nDigite o ponto p%c(%c): ", nome
, coordenada
); if (coordenada == 'X') {
} else {
}
}
int main() {
ponto p1, p2;
lePonto('1', 'X', &p1);
lePonto('1', 'Y', &p1);
lePonto('2', 'X', &p2);
lePonto('2', 'Y', &p2);
printf("\nResultado: %.2f", sqrt(quadradoPontos
(p1.
x, p2.
x) + quadradoPontos
(p1.
y, p2.
y))); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CnR5cGVkZWYgc3RydWN0IHsKICAgIGludCB4OwogICAgaW50IHk7Cn0gcG9udG87CmludCBxdWFkcmFkb1BvbnRvcyhpbnQgcDEsIGludCBwMikgewogICAgcmV0dXJuIHBvdyhwMiAtIHAxLCAyKTsKfQp2b2lkIGxlUG9udG8oY2hhciBub21lLCBjaGFyIGNvb3JkZW5hZGEsIHBvbnRvICpwKSB7CiAgICBwcmludGYoIlxuRGlnaXRlIG8gcG9udG8gcCVjKCVjKTogIiwgbm9tZSwgY29vcmRlbmFkYSk7CiAgICBpZiAoY29vcmRlbmFkYSA9PSAnWCcpIHsKCSAgICBzY2FuZigiJWQiLCAmcC0+eCk7CiAgICB9IGVsc2UgewoJICAgIHNjYW5mKCIlZCIsICZwLT55KTsKICAgIH0KfQppbnQgbWFpbigpIHsKICAgIHBvbnRvIHAxLCBwMjsKICAgIGxlUG9udG8oJzEnLCAnWCcsICZwMSk7CiAgICBsZVBvbnRvKCcxJywgJ1knLCAmcDEpOwogICAgbGVQb250bygnMicsICdYJywgJnAyKTsKICAgIGxlUG9udG8oJzInLCAnWScsICZwMik7CiAgICBwcmludGYoIlxuUmVzdWx0YWRvOiAlLjJmIiwgc3FydChxdWFkcmFkb1BvbnRvcyhwMS54LCBwMi54KSArIHF1YWRyYWRvUG9udG9zKHAxLnksIHAyLnkpKSk7CiAgICByZXR1cm4gMDsKfQ==