| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 80375 | sh25_huangse | 含k个3的数 | C++ | 通过 | 0 MS | 248 KB | 664 | 2026-01-04 15:14:46 |
#include <iostream> using namespace std; int main() { int m, k; cin >> m >> k; // 条件1:能否被19整除 bool divisibleBy19 = (m % 19 == 0); // 条件2:统计数字3的个数 int count3 = 0; int temp = m; // 使用临时变量,避免修改原m while (temp > 0) { int digit = temp % 10; // 取出个位 if (digit == 3) { count3++; } temp /= 10; // 去掉个位 } // 判断两个条件是否同时满足 if (divisibleBy19 && count3 == k) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }