fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int cnt(int n){
  5. int ans = 0;
  6. while (n != 0){
  7. n/=10;
  8. ans++;
  9. }
  10. return ans;
  11. }
  12.  
  13. int main(){
  14. int n; cin >> n;
  15. int ans = 0;
  16. for(int i = 1; i <= n;i++){
  17. int x; cin >> x;
  18. ans += cnt(x);
  19. }
  20. cout << ans;
  21. }
  22.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty