Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int n , x;
- cin >> n;
- x = 0;
- while(n)
- x = 10 * x + n % 10, n /= 10;
- int d;
- for(d = 1; d * d < x ; d++ )
- if(x % d == 0)
- n += 2;
- if(d * d == x)
- n++;
- cout << n;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment