Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int oneBGNCoinCount, twoBGNCoinCount, fiveBGNCoinCount, sum;
- cin >> oneBGNCoinCount >> twoBGNCoinCount >> fiveBGNCoinCount >> sum;
- for (int i = 0; i <= oneBGNCoinCount; i++) {
- for (int j = 0; j <= twoBGNCoinCount; j++) {
- for (int k = 0; k <= fiveBGNCoinCount; k++) {
- if (i * 1 + j * 2 + k * 5 == sum) {
- cout << i << " * 1 lv. + " << j << " * 2 lv. + " << k << " * 5 lv. = " << sum << " lv.\n";
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement