fork download
  1. # include <stdio.h>
  2.  
  3. int myStrlen(char s[]){
  4. int i=0,count=0;
  5. while(s[i]!='\0'){
  6. count++;
  7. i++;
  8. }
  9. return count;
  10. }
  11.  
  12. int main(){
  13. int len;
  14. char s[100];
  15. scanf("%s",s);
  16. len = myStrlen(s);
  17. printf("%s -> %d\n",s,len);
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5276KB
stdin
abcd
stdout
abcd -> 4