SoLoto. 2018-12-22 19:42 采纳率: 0%
浏览 542

可以用这个代码编改写说反话-加强版 吗?

#include
#include
#include
int main(void)
{
int i,n=0;
char color[20],str[15];
scanf("%s",str);
while(str[0]!='#')
{
color[n]=(char *)malloc(sizeof(char)
(strlen(str)+1));
strcpy(color[n],str);
n++;
scanf("%s",str);
}
for(i=n-1;i>=0;i--)
{
printf("%s ",color[i]);
free(color[i]);
}
return 0;
}

  • 写回答

1条回答 默认 最新

  • threenewbee 2018-12-22 15:05
    关注
    评论

报告相同问题?