Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
339816 金奕君 NOIP2010 普及:第一题 数字统计 C++ 通过 100 0 MS 272 KB 266 2025-01-05 14:57:23

Tests(10/10):


#include<bits/stdc++.h> using namespace std; int main() { int n1,n2,num=0,a; cin>>n1>>n2; for (int i=n1;i<=n2;i++) { a=i; while (a>0) { if (a%10==2) num++; a-=(a%10); a/=10; } } cout<<num; }


测评信息: