Lucian_Adrian

#408 Divizorii Oglinditului

Nov 2nd, 2021
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5. int n , x;
  6.  
  7. cin >> n;
  8. x = 0;
  9. while(n)
  10. x = 10 * x + n % 10, n /= 10;
  11.  
  12. int d;
  13. for(d = 1; d * d < x ; d++ )
  14. if(x % d == 0)
  15. n += 2;
  16. if(d * d == x)
  17. n++;
  18.  
  19. cout << n;
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment