This repository has been archived on 2019-08-09. You can view files and clone it, but cannot push or open issues or pull requests.
s4-c/TP1/E2.c

15 lines
457 B
C
Raw Normal View History

2016-01-17 18:39:09 +01:00
/* Programme qui lit et affiche les caractères */
#include <stdio.h>
#include <math.h>
int main() {
double xa, ya, za, xb, yb, zb;
printf("Saisissez les coordonnées du point A sous la forme X,Y,Z\n");
scanf("%lf,%lf,%lf", &xa, &ya, &za);
printf("Saisissez les coordonnées du point B sous la forme X,Y,Z\n");
scanf("%lf,%lf,%lf", &xb, &yb, &zb);
double d = sqrt(pow(xb-xa, 2) + pow(yb-ya, 2) + pow(zb-za, 2));
printf("D = %lf\n", d);
return 0;
}