35657

Untitled

Nov 11th, 2023
742
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 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 a, b;
  10.  
  11.     cout << "Введите начало диапазона: ";
  12.     cin >> a;
  13.  
  14.     cout << "Введите конец диапазона: ";
  15.     cin >> b;
  16.    
  17.     for (int i = a; i <= b; i++) {
  18.         cout << "Делители для числа " << i << ": ";
  19.         for (int j = 1; j <= i; j++) {
  20.             if (i % j == 0) {
  21.                 cout << j << " ";
  22.             }
  23.         }
  24.         cout << endl;
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment