Distancia euclidiana

Run Settings
LanguageC
Language Version
Run Command
#include <stdio.h> #include <stdlib.h> #include <math.h> struct pto { float x; float y; }; int main() { typedef struct pto ponto; int i; ponto a, b; a.x = 1.0; a.y = 1.0; b.x = 3.0; b.y = 3.0; float soma = 0.0; for(int i = 0; i < 2; i++) { soma += (pow((a.x - b.x),2) + pow((a.y - b.y),2)); } sqrt(soma); printf("%.2f",soma); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines