用C++编写一个程序,实现将用户输入的一个字符串中的所有字符‘c’删除,并输出结果

日期:2019-04-07 18:34:10 人气:1

用C++编写一个程序,实现将用户输入的一个字符串中的所有字符‘c’删除,并输出结果

程序代码及运行截图如下:#include using namespace std;int main(){ char s[200],*p,*q; cin.get(s,200); for(p=q=s;*p;p++) if(*p!='c')*q++=*p; *q=*p; cout<<s<<endl; return 0;}
    A+
热门评论