Developpement/23DEV1.1/TPS1/TP01/controle/Comptes.c

30 lines
514 B
C
Raw Normal View History

2024-12-09 11:53:11 +01:00
#include <stdlib.h>
#include <stdio.h>
int main(void) {
int num;
int denier;
int sous;
int livre;
printf("Combien de deniers ? ");
scanf("%d", &num);
livre = (num/12)/20;
sous = (num/12)%20;
denier = (num%20)%12;
if(denier>1){
printf("%d deniers\n", denier);
}else{
printf("%d denier\n", denier);
}
if(sous>1){
printf("%d sous\n", sous);
}else{
printf("%d sous\n", sous);
}
if(livre>1){
printf("%d livres\n", livre);
}else{
printf("%d livre\n", livre);
}
return EXIT_SUCCESS;
}