fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n, contaDig=0;
  8. cin >> n;
  9. while(n>0){
  10. contaDig++;
  11. n = n / 10;
  12. }
  13. cout << contaDig;
  14.  
  15. return 0;
  16.  
  17. }
Success #stdin #stdout 0.01s 5252KB
stdin
12345
stdout
5