Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
29098 while(i++) 自幂数 C++ 通过 100 1 MS 716 KB 529 2022-07-10 19:51:49

Tests(10/10):


#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; }


测评信息: