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. }
  18.  
Success #stdin #stdout 0s 5288KB
stdin
123
stdout
3