比如说键盘输入xyz
要分别输出x,y,z
谢谢了
2条回答 默认 最新
CSDN专家-link 2021-11-08 11:24关注for循环,逐个输出字符就可以了
char s[10]; scanf("%s",s); int i=0; while(s[i] != 0) { printf("%c ",s[i]); i++; }本回答被题主选为最佳回答 , 对您是否有帮助呢?评论 打赏 举报解决 4无用 2
for循环,逐个输出字符就可以了
char s[10];
scanf("%s",s);
int i=0;
while(s[i] != 0)
{
printf("%c ",s[i]);
i++;
}