#include<bits/stdc++.h> using namespace std; typedef long long ll; ll fun(ll x){ ll cnt=0; while(x){ ll tmp=x%10; if(tmp==2)cnt++; x/=10; } return cnt; } int main(){ ll ans=2; for(int i=13;i<=2020;i++)ans+=fun(i); cout<<ans; return 0; }
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 追梦算法网 universal account