fork download
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int count(int n){
  7. //write your code here
  8. if (n==0){
  9. return n;
  10. }
  11. return count(n/10);
  12. }
  13.  
  14. int main(){
  15. int n;
  16. cin >> n;
  17.  
  18. cout << count(n) << endl;
  19. }
Success #stdin #stdout 0.01s 5444KB
stdin
Standard input is empty
stdout
0