Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. long b=0;
  8. unsigned long long n;
  9. cin >> n;
  10. double gg=sqrt(n);
  11. for(int i=1; i<=gg; i++)
  12. {
  13. if(n % i == 0)
  14. cout << i << '\n';
  15. }
  16. for(int i=int(gg); i>=2; i--)
  17. {
  18. if(n % i == 0)
  19. cout << n / i << '\n';
  20. }
  21. cout.flush();
  22. cout<<n;
  23. for(int i=1;i<=n;i++)
  24. {
  25. if(n%i==0)
  26. b++;
  27. }
  28. cout<<endl<<"Liczba dzielnikow to "<<b;
  29. if(b==2)
  30. {
  31. cout<<endl<<"To jest liczba pierwsza";
  32. }
  33. else
  34. {
  35. cout<<endl<<"To jest liczba zlozona";
  36. }
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement