#17891: c++ AC


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

學校 : 不指定學校
編號 : 89827
來源 : [140.114.87.235]
最後登入時間 :
2025-10-05 14:35:49

#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 (梅子)

學校 : 臺北市私立延平高級中學
編號 : 83262
來源 : [1.162.106.32]
最後登入時間 :
2019-12-01 20:32:51

whike(r)是什麼意思




#17894: Re:c++ AC


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

學校 : 臺北市私立延平高級中學
編號 : 83268
來源 : [203.72.178.1]
最後登入時間 :
2023-10-30 13:02:50

whike(r)是什麼意思


r=0

跳出迴圈