Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
54963 | 该账号已封禁 | 数字统计 | C++ | Accepted | 0 MS | 248 KB | 212 | 2024-11-01 15:37:04 |
#include<iostream> using namespace std; int main() { int L,R; cin>>L>>R; int S=0; for(int n=L;n<=R;n++){ int k=n; while(k!=0){ if(k%10==2){ S++; } k/=10; } } cout<<S; }