提示: 作者被禁止或删除 内容自动屏蔽
[CODE]#include<iostream>
using namespace std;
const int arrysize=20;
int main()
{
char str[arrysize],ch;
cout<<"请输入一字符串:";
cin.getline(str,arrysize);
cout<<"请输入你要删除的字符:";
cin>>ch;
int i,j;
for(i=0,j=0; str[j]!='\0'; j++)
{
if(str[j]!=ch)
str[i++] = str[j];
}
str[i] = '\0';
cout<<"修改后的字符串为:"<<str<<endl;
system("pause");
return 0;
} [/CODE]