Advertisement
Avdluna

URI 1018

May 16th, 2015
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){
  3. int x,q;
  4. scanf("%d",&x);
  5. printf("%d\n",x);
  6. printf("%d nota(s) de R$ 100,00\n",q=x/100);
  7. x-=(q*100);
  8. printf("%d nota(s) de R$ 50,00\n",q=x/50);
  9. x-=(q*50);
  10. printf("%d nota(s) de R$ 20,00\n",q=x/20);
  11. x-=(q*20);
  12. printf("%d nota(s) de R$ 10,00\n",q=x/10);
  13. x-=(q*10);
  14. printf("%d nota(s) de R$ 5,00\n",q=x/5);
  15. x-=(q*5);
  16. printf("%d nota(s) de R$ 2,00\n",q=x/2);
  17. x-=(q*2);
  18. printf("%d nota(s) de R$ 1,00\n",q=x/1);
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement