Advertisement
Fargoth_Cor

Untitled

Oct 15th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <cmath>
  4. using namespace std;
  5. int main() {
  6.     int x, k = 0;
  7.     cin >> x;
  8.     if (x == 1) {
  9.         cout << 1;
  10.         return 0;
  11.     }
  12.     int i = 2;
  13.     for (i; i < sqrt(x); i++) {
  14.         if (x % i == 0) {
  15.             k++;
  16.         }
  17.     }
  18.     if (i == sqrt(x)) {
  19.         cout << (k * 2) + 3;
  20.     }
  21.     else
  22.     cout << (k * 2) + 2;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement