Advertisement
STANAANDREY

bacT4 SIII 1

May 28th, 2021
1,366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void generatoare(int n) {
  5.     int a, b;
  6.     for (int a = 2; a <= n; a += 2) {
  7.         int b = 1;
  8.         while (a * b + a / b < n) {
  9.             b++;
  10.         }
  11.         if (a * b + a / b == n) {
  12.             cout << a << '-' << b << ' ';
  13.         }
  14.     }
  15. }
  16.  
  17. int main() {
  18.     //call here
  19.     return 0;
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement