fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main() {
  4. char str[100];
  5. fgets(str, 100, stdin);
  6. char *word = strtok(str, " \n");
  7. while (word != NULL) {
  8. printf("Length of '%s': %lu\n", word, strlen(word));
  9. word = strtok(NULL, " \n");
  10. }
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty