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