fork(12) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int x, n=1;
  6. cin >> x;
  7. while ((x/=10) > 0) n++;
  8. cout << n;
  9. return 0;
  10. }
Success #stdin #stdout 0s 3464KB
stdin
123
stdout
3