Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <set>
- #include <vector>
- #include <algorithm>
- using namespace std;
- long long Arm_Strong(int x)
- {
- int Sum = 0;
- int temp =x;
- int n = 0;
- while (temp > 0)
- {
- temp /= 10;
- n++;
- }
- temp = x;
- while (temp > 0)
- {
- int k = temp % 10;
- for (int j = 1; j < n; j++)
- k *= temp % 10;
- temp /= 10;
- Sum += k;
- }
- if (Sum == x)
- return true;
- return false;
- }
- signed main()
- {
- int x;
- cin >> x;
- cout << Arm_Strong(x);
- cin >> x;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement