Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int mynt[] = {5000,2000,1000,500,100,50,10,5,1};
- int upphaed(0);
- cout << "how much money do you have? ";
- cin >> upphaed;
- for(int i = 0; i < 9;++i)
- {
- cout << upphaed / mynt[i] << " x " << mynt[i] << "kr\n";
- upphaed %= mynt[i];
- }
- }
Add Comment
Please, Sign In to add comment