MeehoweCK

Untitled

Apr 29th, 2021
769
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.  
  3. using namespace std;
  4.  
  5. void najmniejsza_roznica_dzielnikow(unsigned liczba)
  6. {
  7.     unsigned d;
  8.     for(unsigned i = 1; i*i <= liczba; ++i)
  9.         if(liczba % i == 0)
  10.             d = i;
  11.     cout << liczba << " = " << d << " * " << liczba / d << endl;
  12. }
  13.  
  14. int main()
  15. {
  16.     najmniejsza_roznica_dzielnikow(1724);
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment