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