Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
38148 yuzhengxun 数字统计 C++ 通过 1 MS 252 KB 219 2024-01-25 14:40:15

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main() { int l,r,c=0; cin>>l>>r; for(int i=l;i<=r;i++){ int s=i; while(s){ if(s%10==2){ c++; } s/=10; } } cout<<c; return 0; }


测评信息: