首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
字符串去特定字符
[编程题]字符串去特定字符
热度指数:10355
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 64M,其他语言128M
算法知识视频讲解
输入字符串s和字符c,要求去掉s中所有的c字符,并输出结果。
输入描述:
测试数据有多组,每组输入字符串s和字符c。
输出描述:
对于每组输入,输出去除c字符后的结果。
示例1
输入
heallo a
输出
hello
马上挑战
算法知识视频讲解
提交运行
算法知识视频讲解
添加笔记
求解答(9)
邀请回答
收藏(65)
分享
提交结果有问题?
79个回答
13篇题解
开通博客
JavaGPT
发表于 2022-01-22 22:19:04
#include <iostream> using namespace std; int main(){ string str; char c; while(cin>>str>>c){ for(int i=0;i<
展开全文
用户抉择
发表于 2021-03-29 20:31:01
#include <stdio.h> #include <string.h> int main() { char s[100],c; int
展开全文
芙兰
发表于 2023-03-08 21:34:11
#include <iostream> #include <algorithm> using namespace std; int main() { string s; char c; while ( cin >> s ) { // 注意
展开全文
荞麦假面
发表于 2025-03-14 10:08:04
#include <iostream> using namespace std; int main() { string str; char c; while (cin >> str) { cin >> c;
展开全文
路人萌Miranda
发表于 2022-03-13 10:16:48
#include <cstdio> #include <string> using namespace std; int main() { string s; char c; while (cin >> s >> c) { for(int
展开全文
真新镇小智要成为宝可梦大师
发表于 2025-03-23 22:53:34
#include <cwchar> #include <iostream> #include<string> using namespace std; int main() { string s; char c; while (getli
展开全文
小猴努力学算法
发表于 2023-03-18 22:23:20
#include <iostream> #include<cstring> using namespace std; int main() { string a; char c; while (getline(cin, a)) { c
展开全文
陶良策
发表于 2025-03-04 18:58:01
#include <iostream> using namespace std; int main() { string s; char c; while (cin >> s) { // 注意 while 处理多个 case cin.
展开全文
MountainsHao
发表于 2024-04-01 15:33:49
#include <stdio.h> #include <string.h> int main() { char a[1000]; while (scanf("%999s", a) != EOF) { int len =
展开全文
Brillianman
发表于 2023-02-14 11:33:06
#include <stdio.h> #include<string.h> int main() { char c, s[100]; gets(s); c = getchar(); int i, n = strlen(s); for
展开全文
问题信息
字符串
难度:
79条回答
65收藏
10116浏览
热门推荐
通过挑战的用户
查看代码
爱读书的伊泽瑞...
2023-03-10 13:57:27
999_999_99
2023-03-06 13:37:02
刷了100道题...
2023-03-04 10:56:58
_cherry
2023-02-28 10:07:11
牛客85819...
2023-02-24 21:12:41
相关试题
3.下列关于表中西部省市区2006...
资料分析
言语理解与表达
资料分析
评论
(1)
4.该校1997年男女教师的比例为...
资料分析
言语理解与表达
资料分析
评论
(1)
计算机在工作过程中,若突然停电,(...
计算机常识
普及
C++
Pascal
选择题
评论
(1)
来自
NOIP2008初赛普及组
Mysql中表student_in...
数据库
SQL
评论
(1)
SQL中,下列涉及空值的操作不正确...
SQL
评论
(0)
字符串去特定字符
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题
heallo a
hello