fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void) {
  5. char s[130] = {0};
  6. char *p = s;
  7. int i = 0;
  8. fgets(s, 129, stdin);
  9. while (*p != '\n' && *p != '\0') {
  10. i++;
  11. p++;
  12. }
  13. printf("len : %d\n", i);
  14. return EXIT_SUCCESS;
  15. }
Success #stdin #stdout 0.02s 1680KB
stdin
Mr. Satan
stdout
len : 9