首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
18296543453
2025年2月15日 13:13
字符串去特定字符 题解:
P1362
回复 0
|
赞 2
|
浏览 474
#include <iostream> #include<string> using namespace std; char str[1000010]; char ch; int main() { cin>>str; cin>>ch; for(int i=0;str[i];i++){ if(str[i]==ch)continue; else cout<<str[i]; } ...
小王桐学
2024年2月23日 20:50
字符串去特定字符 题解:C
P1362
回复 0
|
赞 4
|
浏览 635
#include <stdio.h> #include <string.h> int main() { char s[1000],c; while(scanf("%s",s) != EOF) { scanf(" %c",&c); char *p = s; while(*p != '\0') { if(*p != c) printf("%c",*p); p++; } printf("\n"); } return 0; }
莫小七
2020年2月24日 11:57
1362字符串去特定字符(用string函数)
P1362
回复 0
|
赞 3
|
浏览 9.0k
#include<iostream> #include<cstring> #include<string> using namespace std; int main() { string s; while (cin >> s) { char c; cin >> c; int pos = 0; while ((pos = s.find(c)) != -1) { s.erase(pos, 1); } cout << s << en...
题目
字符串去特定字符
题解数量
3
发布题解
在线答疑
热门题解
1
字符串去特定字符 题解:C
2
1362字符串去特定字符(用string函数)
3
字符串去特定字符 题解: