Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
383060 | 91 666 | NOIP2010 普及:第一题 数字统计 | C++ | Accepted | 100 | 0 MS | 280 KB | 266 | 2025-03-02 11:09:49 |
#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; }