Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
71816 刘宇轩 数字统计 C++ Accepted 1 MS 280 KB 245 2024-04-27 17:12:45

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a,b,m=0,k; cin>>a>>b; for(int i=a;i<=b;i++){ k=i; while(k!=0){ if(k%10==2){ m++; } k=k/10; } } cout<<m; return 0; }