Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <locale>
- using namespace std;
- void main(){
- int* b = new int[6]; int S; int a[] = { 5000, 1000, 500, 100, 50, 10 };
- int i;
- setlocale(LC_ALL, "rus");
- cout << "Введите сумму" << "\n";
- cin >> S;
- b[0] = S / a[0];
- if (b[0] > 0) cout << b[0] << " Купюр достоинством " << a[0] << "\n";
- for (i = 1; S > 0 && i < 7; i++)
- {
- b[i] = (S%a[i - 1]) / a[i];
- if (b[i] != 0) cout << b[i] << " Купюр достоинством " << a[i] << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment