1 条题解
-
0
乱写的,AC不了骗你的#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d = 0, j, e; while (cin >> a >> b) { j = 0; d = 0; e = 0; if (a == 0) return 0; if (a == 10) { c = b; while (c > 0) { d += c % 10; c /= 10; } if (b % d == 0) cout << "yes" << endl; else cout << "no" << endl; } if (a != 10) { c = b; while (c > 0) { d += (c % 10) * pow(a, j); j++; c /= 10; } c = b; while (c > 0) { e += c % 10; c /= 10; } if (d % e == 0) cout << "yes" << endl; else cout << "no" << endl; } } return 0; }
信息
- ID
- 2511
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 7
- 标签
- 递交数
- 267
- 已通过
- 57
- 上传者