• + 0 comments
    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    #include <stdlib.h>
    #include <ctype.h>
    
    int main() {
    
        char *s;
        s = malloc(1024 * sizeof(char));
        scanf("%[^\n]", s);
        s = realloc(s, strlen(s) + 1);
        
        for(int i = 0; i < strlen(s); i++) {
            if(s[i] == '\x20'){ // ASCII for space is \40, hex for \40 is \x20
                printf("\n");
                continue;
            }
            printf("%c", s[i]);
        }
    
        return 0;
    }