Advertisement
Thiagofsr

URI ONLINE - 1018

Feb 13th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4.  
  5. int main()
  6. { int N1;
  7. scanf ("%d", &N1);
  8. // Com notas
  9.  
  10. printf("%d\n", N1);
  11.  
  12.     printf("%i nota(s) de R$ 100,00\n", N1/100 );
  13.  
  14.     printf("%i nota(s) de R$ 50,00\n", (N1%100)/50);
  15.  
  16.     printf("%i nota(s) de R$ 20,00\n", (N1%100)%50/20);
  17.  
  18.     printf("%i nota(s) de R$ 10,00\n", (N1%100)%50%20/10);
  19.  
  20.     printf("%i nota(s) de R$ 5,00\n",(N1%100)%50%20%10/5);
  21.  
  22.     printf("%i nota(s) de R$ 2,00\n", (N1%100)%50%20%10%5/2);
  23.  
  24.     printf("%i nota(s) de R$ 1,00\n", (N1%100)%50%20%10%5%2/1);
  25.  
  26.  
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement