编写程序,通过键盘任一输入一个字符串,然后从第一个字母开始间隔的输出该字符串,用指针完成

例如输入computer,则输出c o m p u t e r

第1个回答  2014-06-28
#include<stdio.h>
#include<stdlib.h>

int main(void)
{
char str[100];
char *p = str;
scanf("%s", str);
while(*p != 0){
printf("%c ", *p++);
}
printf("\n");
}本回答被提问者采纳
相似回答