急求程序设计问题: 采用顺序存储存储串,输入一个字符串r,删除r中所有值等于ch的字符。(需详细解读

如题所述

这个程序符合需求,你运行一下
/* Note:Your choice is C IDE */
#include "stdio.h"

void main()
{
char a[100],ch;
char b[100]={0};
int i=0,j=0;
gets(a);
printf("please input the letter you want to delete:\n");
scanf("%c",&ch);
while(*(a+i)!='\0')
{
if(*(a+i)!=ch)
{
*(b+j)=*(a+i);
i++;
j++;
}
else
{

i++;

}

}
*(b+i)='\0';

puts(b);
}追问

不知道您能否详讲解一下这个程序呢?

追答

这个,呵呵,不会的加群218691837

温馨提示:答案为网友推荐,仅供参考
相似回答