!i • 1年前
评论:
include<bits/stdc++.h> using namespace std;
int main() { int l,r,s=0,n;
cin>>l>>r; for(int i=l;i<=r;i++) { n=i; while(n>0){
if(n%10==2) s=s+1; n=n/10; }} cout<<s<<endl; return 0; }
超好用
请先登录,才能进行评论