Advertisement
programusy

Untitled

May 31st, 2023
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int kwota,kwota2,piatki,dwojki,i=0,j=0;
  8. cout << "Podaj kwote: ";
  9. cin >> kwota;
  10. kwota2 = kwota;
  11. do{
  12. if(kwota >= 5)
  13. {
  14. kwota = kwota - 5;
  15. i++;
  16. }
  17. else
  18. {
  19. cout << "Ilosc 5: " << i;
  20. }
  21. }while(kwota >=5);
  22. cout << "Ilosc 5: " << i << endl;
  23.  
  24. do{
  25. if(kwota2 >= 2)
  26. {
  27. kwota2 = kwota2 - 2;
  28. j++;
  29. }
  30. else
  31. {
  32. cout << "Ilosc 2: " << j;
  33. }
  34. }while(kwota2 >=2);
  35.  
  36. cout << "Ilosc 2: " << j << endl;
  37. return 0;
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement