题解在此
2025-08-18 17:03:39
发布于:浙江
1阅读
0回复
0点赞
#include <iostream>
using namespace std;
int main(){
int l,r;
cin>>l>>r;
int ans=0;
for (int i=l;i<=r;i++){
string s=to_string(i);
for (int j=0;j<s.size();j++){
if (s[j]=='2'){
ans++;
}
}
}
cout<<ans;
return 0;
}
这里空空如也
有帮助,赞一个