fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. // zdefiniuj funkcję
  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.  
  20. int main() {
  21. // sprawdź działanie funkcji
  22. cout << trzy(11) << " " << trzy(99) << endl;
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
3 21