You are viewing a single comment's thread. Return to all comments →
#include <stdio.h> #include <string.h> #include <ctype.h> #include <stdlib.h> int main(){ char *s; s = malloc(1024 * sizeof(char)); scanf("%[^\n]", s); s = realloc(s, strlen(s)+1); int l = strlen(s); for(int i = 0; i < l; i++){ if(isalnum(s[i])){ printf("%c", s[i]); } else if(!isalnum(s[i]) && isalnum(s[i+1])){ printf("\n"); } } printf("\n"); free(s); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Printing Tokens
You are viewing a single comment's thread. Return to all comments →