Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int tab[6] = {500,200,100,50,20,10};
- int n; // kwota\
- int k; // ilosc bankonotow;
- int diw;
- int main(int argc, char *argv[])
- {
- cout << "Podaj kwote jaka chcesz wplacic.";
- cin >> n;
- for (int i = 0;i < 7 ;i++)
- {
- diw = div(n,tab[i]);
- if (diw == 0)
- {
- diw = div(n,tab[i++])
- }
- else
- cout << "Wyplacam: " << diw << " z" << tab[i++];
- n -= diw*tab[i++]
- }
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement