Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- std::ios_base::sync_with_stdio(0);
- unsigned long long n, counter = 0;
- cin >> n;
- while(n != 0)
- {
- double gg = sqrt(n);
- for(int i = 2; i <= gg; i++)
- {
- gg = sqrt(n);
- if(gg < 2) break;
- if(n % i == 0)\
- {
- n /= (n / i);
- counter++;
- i = 1;
- }
- }
- counter++;
- n--;
- }
- cout << counter;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement