30 lines
514 B
C
30 lines
514 B
C
#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;
|
|
} |