fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n, i=0;
  5. scanf("%d",&n);
  6.  
  7. while(n!=0){
  8. n=n/10;
  9. i=i+1;
  10. }
  11.  
  12. printf("%d",i);
  13. return 0;
  14. }
Success #stdin #stdout 0s 5296KB
stdin
-123456789
stdout
9