Sunday, September 15, 2019

AtCoder Beginner Contest 136(B - Uneven Numbers)

  1. #include< bits/stdc++.h >
  2. using namespace std;
  3. int main(){
  4. int n, ans = 0;
  5. cin >> n;
  6. for(int i = 1; i <= n; i++) {
  7. string s;
  8. stringstream ss;
  9. ss << i;
  10. ss >> s;
  11. if(s.size()%2) ans++;
  12. }
  13. cout << ans << endl;
  14. return 0;
  15. }

No comments: