fork download
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include <string.h>
  4.  
  5. int main(void) {
  6. char * words = malloc(1000);
  7. fgets(words, 1000, stdin);
  8. char * c = strtok(words, " +-.");
  9. while(c != NULL){
  10. printf("%c\n", c[0]);
  11. /*for(int i=0; i<strlen(c); i++){
  12. printf("%c\n", c[i]);
  13. }*/
  14. c = strtok(NULL, " +-.");
  15. }
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5312KB
stdin
This was a sentence
stdout
T
w
a
s