Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int tab[6] = {500,200,100,50,20,10};
  7. int n; // kwota\
  8. int k; // ilosc bankonotow;
  9. int diw;
  10. int main(int argc, char *argv[])
  11. {
  12. cout << "Podaj kwote jaka chcesz wplacic.";
  13. cin >> n;
  14. for (int i = 0;i < 7 ;i++)
  15. {
  16. diw = div(n,tab[i]);
  17. if (diw == 0)
  18. {
  19. diw = div(n,tab[i++])
  20. }
  21. else
  22. cout << "Wyplacam: " << diw << " z" << tab[i++];
  23. n -= diw*tab[i++]
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. system("PAUSE");
  32. return EXIT_SUCCESS;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement