1 条题解
-
0
202603zj08王宇浩 (王宇浩) LV 8 @ 2026-05-16 14:08:38
#include<bits/stdc++.h> using namespace std; int a,b; int bea_num(int a,int b) { int ans=0,cnt=0; for (int i=a;i<=b;i++) { cnt=0; int it=i; while (it) { if (it%10==2) cnt++; it/=10; } if (cnt==3) ans++; } return ans; } int main() { cin>>a>>b; cout<<bea_num(a,b); return 0; }
- 1
信息
- ID
- 3049
- 难度
- 3
- 分类
- (无)
- 标签
- 递交数
- 45
- 已通过
- 24
- 通过率
- 53%
- 上传者