diff options
Diffstat (limited to '429/word.c')
| -rw-r--r-- | 429/word.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/429/word.c b/429/word.c new file mode 100644 index 0000000..f8363aa --- /dev/null +++ b/429/word.c @@ -0,0 +1,25 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +int main(){ + int tc; + char *word = malloc(10); + size_t st = 10; + scanf("%d", &tc); + while(tc--){ + getline(&word, &st, stdin); /* blank line after tc number */ + char dict[200][10]; + int i = 0; + + getline(&word, &st, stdin); + while(word[0]!='*'){ + memcpy(dict[i++], word, st); + getline(&word, &st, stdin); + } + int j=0; + for(;j<i; j++){ + printf("%s", dict[j]); + } + } +} |
