Guest User

Untitled

a guest
Jan 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.69 KB | None | 0 0
  1. int main()
  2. {
  3.     int ib500,ib200,ib100,ib50,ib20,ib10,ib5,ip2,ip1,inombre;
  4.     float fnombre,fp50,fp20,fp10,fp5c,fp2c,fp1c;
  5.  
  6.     printf("\n\n====DISTRIBUTEUR DE BILLETS====\n");
  7.     printf("\nCombien voulez vous retirer ?\n");
  8.     scanf("%f",&fnombre);
  9.  
  10.     inombre=fnombre;
  11.  
  12.     /* Decomposition des billets */
  13.  
  14.     ib500=inombre/500;
  15.     inombre=inombre%500;
  16.  
  17.     ib200=inombre/200;
  18.     inombre=inombre%200;
  19.  
  20.     ib100=inombre/100;
  21.     inombre=inombre%100;
  22.  
  23.     ib50=inombre/50;
  24.     inombre=inombre%50;
  25.  
  26.     ib20=inombre/20;
  27.     inombre=inombre%20;
  28.  
  29.     ib10=inombre/10;
  30.     inombre=inombre%10;
  31.  
  32.     ib5=inombre/5;
  33.     inombre=inombre%5;
  34.  
  35.     ip2=inombre/2;
  36.     inombre=inombre%2;
  37.  
  38.     ip1=inombre;
  39.  
  40.  
  41.     /* Decomposition des centimes */
  42.  
  43.     float (fnombre)
  44.  
  45.     fp50=fnombre/50;
  46.     fnombre=fnombre%50;
  47.  
  48.     fp20=fnombre/20;
  49.     fnombre=fnombre%20;
  50.  
  51.     fp10=fnombre/10;
  52.     fnombre=fnombre%10;
  53.  
  54.     fp5c=fnombre/5;
  55.     fnombre=fnombre%5;
  56.  
  57.     fp2c=fnombre/2;
  58.     fnombre=fnombre%2;
  59.  
  60.     fp1c=fnombre%100;
  61.  
  62.     printf("\n\n %d billets de 500",ib500);
  63.     printf("\n\n %d billets de 200",ib200);
  64.     printf("\n\n %d billets de 100",ib100);
  65.     printf("\n\n %d billets de 50",ib50);
  66.     printf("\n\n %d billets de 20",ib20);
  67.     printf("\n\n %d billets de 10",ib10);
  68.     printf("\n\n %d billets de 5",ib5);
  69.     printf("\n\n %d pieces de 2",ip2);
  70.     printf("\n\n %d pieces de 1",ip1);
  71.     printf("\n\n %f pieces de 50",fp50);
  72.     printf("\n\n %f pieces de 20",fp20);
  73.     printf("\n\n %f pieces de 10",fp10);
  74.     printf("\n\n %f pieces de 5",fp5c);
  75.     printf("\n\n %f pieces de 2",fp2c);
  76.     printf("\n\n %f pieces de 1",fp1c);
  77.  
  78.     return 0;
  79.  
  80.  
  81.  
  82. }
Add Comment
Please, Sign In to add comment