35657

Untitled

Feb 9th, 2024
803
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7.     setlocale(LC_ALL, "ru");
  8.  
  9.     int a, b;
  10.  
  11.     cout << "Введите начало диапазона: ";
  12.     cin >> a;
  13.     cout << "Введите конец диапазона: ";
  14.     cin >> b;
  15.  
  16.     for (int i = a; i <= b; i++) {
  17.         cout << "Делители числа " << i << ": ";
  18.         for (int j = 1; j <= i; j++) {
  19.             if (i % j == 0) {
  20.                 cout << j << " ";
  21.             }
  22.         }
  23.         cout << endl;
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment