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