提交时间:2022-07-10 19:51:49

运行 ID: 29098

#include <iostream> #include <stack> using namespace std; int main() { int a; cin >> a; int copy = a; int times = 0; stack<int> stk; while(copy) { stk.push(copy % 10); copy /= 10; times++; } while(!stk.empty()) { int temp = 1; for(int i = 0; i < times; i++) { temp *= stk.top(); } copy += temp; stk.pop(); } cout << (copy == a ? "Yes" : "No") << endl; return 0; }