35657

Untitled

Oct 28th, 2023
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7.     setlocale(LC_ALL, "ru");
  8.    
  9.     int total, unit;
  10.  
  11.     cout << "Введите общее количество ткани: ";
  12.     cin >> total;
  13.  
  14.     cout << "Введите количество ткани на единицу: ";
  15.     cin >> unit;
  16.  
  17.     int count = 0;
  18.  
  19.     while (total >= unit) {
  20.         total -= unit;
  21.         count++;
  22.     }
  23.  
  24.     cout << count << endl;
  25. }
  26.  
  27.  
Advertisement
Add Comment
Please, Sign In to add comment