summaryrefslogtreecommitdiff
path: root/429/word.c
blob: f8363aa5dbef92188d805d4d1809bb27b6158490 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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]);
	}
    }
}