fork download
  1. #include <stdio.h>
  2. struct ponto{
  3. float x;
  4. float y;
  5.  
  6. };
  7. typedef struct ponto Ponto;
  8. int main(void) {
  9. float d;
  10. Ponto p1;
  11. Ponto p2;
  12. p2.x=1;
  13. p2.y=1;
  14. p1.x=4;
  15. p2.y=5;
  16.  
  17. d=sqrt(pow(p2.x-p1.x,2)+pow(p2.y-p1.y,2));
  18. printf("A distancia e: %.2f",d);
  19. }
  20.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
A distancia e: 5.83