Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include<stdio.h>
  2. void main()
  3. {
  4.  
  5. int N, n100=0, n50=0, n20=0, n10=0, n5=0, n2=0, n1=0;
  6. scanf("%d",&N);
  7. if(N>=100)
  8. {
  9. n100= N/100;
  10. N=N%100;
  11. }
  12. if (N>=50)
  13. {
  14. n50 = N/50;
  15. N=N%50;
  16. }
  17. if(N>=20)
  18. {
  19. n20 = N/20;
  20. N=N%20;
  21. }
  22. if(N>=10)
  23. {
  24. n10= N/10;
  25. N=N%10;
  26. }
  27. if(N>=5)
  28. {
  29. n5= N/5;
  30. N=N%5;
  31. }
  32. if(N>=2)
  33. {
  34. n2=N/2;
  35. N=N%2;
  36. }
  37. if(N>=1)
  38. {
  39. n1=N/1;
  40. }
  41. printf("%d nota(s) de R$ 100,00\n%d nota(s) de R$ 50,00\n%d nota(s) de R$ 20,00\n%d nota(s) de R$ 10,00\n%d nota(s) de R$ 5,00\n%d nota(s) de R$ 2,00\n%d nota(s) de R$ 1,00\n", n100,n50,n20,n10,n5,n2,n1);
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement