//I enjoyed doing this exerise
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
int size,i;
printf("How many words do you wish to enter?");
scanf("%d", &size);
char **a = malloc(size * sizeof(char*));
printf("Enter %d words now :\n",size);
for(i=0;i<size;i++)
{
char b[100];
scanf("%s", b);
int n = strlen(b)+1;//'\0'
char* str = malloc(n * sizeof(char));
for (int j = 0; j < n; ++j)
str[j] = b[j];
a[i] = str;
}
for (i = 0; i < size; i++)
printf("%s\n",a[i]);
for (i = 0; i < size; i++)
free(a[i]);
free(a);
return 0;
}