fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. // zdefiniuj funkcje
  5. int trzy(int kwota) {
  6. int liczba = 0;
  7.  
  8. liczba += kwota / 5;
  9. kwota %= 5;
  10.  
  11. liczba += kwota / 3;
  12. kwota %= 3;
  13.  
  14. liczba += kwota; // reszta to monety 1
  15.  
  16. return liczba;
  17. }
  18.  
  19. int main() {
  20. // sprawdź działanie funkcji
  21. cout << trzy(11) << " " << trzy(99) << endl;
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5300KB
stdin
Standard input is empty
stdout
3 21