29 lines
569 B
C
29 lines
569 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <math.h>
|
|
|
|
int main(void) {
|
|
double taille;
|
|
double pouce;
|
|
int poucei;
|
|
double pieds;
|
|
int piedsi;
|
|
printf("Entrez votre taille : ");
|
|
scanf("%lf", &taille);
|
|
pouce = trunc(taille*100.0)/2.56;
|
|
poucei = floor(pouce);
|
|
poucei = poucei % 12;
|
|
pieds = ceil(round(pouce / 12));
|
|
piedsi = pieds;
|
|
if(piedsi > 1){
|
|
printf("%d pieds, ", piedsi);
|
|
}else{
|
|
printf("%d pied, ", piedsi);
|
|
}
|
|
if(poucei > 1){
|
|
printf("%d pouces\n", poucei);
|
|
}else{
|
|
printf("%d pouce\n", poucei);
|
|
}
|
|
return EXIT_SUCCESS;
|
|
} |