summaryrefslogtreecommitdiff
path: root/429
diff options
context:
space:
mode:
authorAditya Naik2019-03-01 04:54:05 -0500
committerAditya Naik2019-03-01 04:54:05 -0500
commitede1a38950db4778b20573a05c8de50c2458c958 (patch)
treeafc4fd0b60d6618df0bb5cd16db1d622cdb069dd /429
parent032ffe90491fd692cead2c17db6ac0a1f6479d95 (diff)
146 AC
Diffstat (limited to '429')
-rw-r--r--429/in67
-rw-r--r--429/in27
-rw-r--r--429/word.c25
3 files changed, 99 insertions, 0 deletions
diff --git a/429/in b/429/in
new file mode 100644
index 0000000..b79b8e8
--- /dev/null
+++ b/429/in
@@ -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
diff --git a/429/in2 b/429/in2
new file mode 100644
index 0000000..8adc3ce
--- /dev/null
+++ b/429/in2
@@ -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]);
+ }
+ }
+}