Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
40210 | 奚晨瑞 | 数字统计 | C++ | Accepted | 1 MS | 248 KB | 216 | 2024-02-08 13:43:37 |
#include<iostream> using namespace std; int main() { int L,R; cin>>L>>R; int S=0; for(int n=L;n<=R;n++){ int n1=n; while(n1!=0){ if(n1%10==2){ S++; } n1/=10; } } cout<<S; }