Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
80579 sh25_huangse 数字统计 C++ 通过 0 MS 240 KB 393 2026-01-04 15:22:51

Tests(1/1):


#include <iostream> using namespace std; int main() { int L, R; cin >> L >> R; int total = 0; for (int i = L; i <= R; i++) { int num = i; while (num > 0) { if (num % 10 == 2) { // 检查当前位是否为2 total++; } num /= 10; } } cout << total << endl; return 0; }


测评信息: