Advertisement
Guest User

Untitled

a guest
Nov 25th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. long long ans(long long x)
  6. {
  7.     long long res = 0;
  8.     for (int i = 1 ; i <= sqrt(x) ; i ++)
  9.         if (x % i == 0)
  10.         {
  11.             res++;
  12.             if (i * i != x)
  13.                 res++;
  14.         }
  15.     return res;
  16. }
  17.  
  18. int main()
  19. {
  20.     long long a; cin >> a;
  21.     cout << ans(a) << endl;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement