diff options
| author | Aditya Naik | 2019-03-01 04:54:05 -0500 |
|---|---|---|
| committer | Aditya Naik | 2019-03-01 04:54:05 -0500 |
| commit | ede1a38950db4778b20573a05c8de50c2458c958 (patch) | |
| tree | afc4fd0b60d6618df0bb5cd16db1d622cdb069dd /429 | |
| parent | 032ffe90491fd692cead2c17db6ac0a1f6479d95 (diff) | |
146 AC
Diffstat (limited to '429')
| -rw-r--r-- | 429/in | 67 | ||||
| -rw-r--r-- | 429/in2 | 7 | ||||
| -rw-r--r-- | 429/word.c | 25 |
3 files changed, 99 insertions, 0 deletions
@@ -0,0 +1,67 @@ +4 + +dip +lip +mad +map +maple +may +pad +pip +pod +pop +sap +sip +slice +slick +spice +stick +stock +* +spice stock +may pod + +dip +lip +mad +map +mapl +maple +may +pad +pip +pod +pop +sap +sip +slice +slick +spice +stick +stock +* +spice slick +may mad +map maple +maple map +map map + +mapl +maple +mba +mbal +mbale +mbple +* +mba mapl + +map +mapl +maple +mba +mbal +mbale +mbp +mbple +* +mba mapl @@ -0,0 +1,7 @@ +1 + +pip +slkdj +sdwi +sdkj +*
\ No newline at end of file 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]); + } + } +} |
