#17891: c++ AC


Easonsfriend (去寫./Problems?ownerid=89827)


#include<bits/stdc++.h>
using namespace std;

//好像不太健康
int main()
{
    int l,r,ans=0;
    cin>>l>>r;
    for(int i=l;i<=r;i++)
    {
        int r=i;
        while(r)
        {
            if(r%10==2)ans++;
            r/=10;
        }
    }
    cout<<ans<<endl;
}
#17893: Re:c++ AC


HelloIan (梅子)


whike(r)是什麼意思




#17894: Re:c++ AC


ufve0704 (爬 我爬 我爬爬爬 有排行榜這種東西就是要爬 爬過我上面的那...)


whike(r)是什麼意思


r=0

跳出迴圈