#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define W_SIZE 15
int main()
{
char (*pl)[W_SIZE];
int words;
int i=0;
int k;
printf("How many words do you wish to enter:");
scanf("%d",&words);
printf("Enter %d words now.\n",words);
pl=(char (*)[W_SIZE])malloc(words*W_SIZE*sizeof(char));
while(i<words&&scanf("%s",pl[i])==1)
i++;
printf("Here are your words:\n");
for(k=0;k<words;k++)
puts(pl[k]);
free(pl);
return 0;
}
C Primer plus 6th 第12章9题参考答案
最新推荐文章于 2024-09-15 22:05:05 发布