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