首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
雨梦のkira
2024年3月26日 19:20
字符串替换 题解:
P2011
回复 0
|
赞 3
|
浏览 886
看不懂的话就用双重循环吧~,如果有多个tantan, #include <bits/stdc++.h> using namespace std; int main() { string s; string sp = "baibai"; bool isExact = false; cin>>s; for(auto &ss : s){ ss = tolower(ss); } //Find the all position of "tantan" for(int i = 0;i < s.siz...
Cookie‘s AE86
2024年3月26日 15:54
字符串替换 题解:C++ find()、replace()实现
P2011
回复 0
|
赞 5
|
浏览 1.4k
#include<bits/stdc++.h> using namespace std; int main (){ string s; cin >> s; transform(s.begin(), s.end(),s.begin() ,::tolower); int index = s.find("tantan", index); if(index == -1){ cout << "not find" << endl; return 0; ...
望雨天
2024年3月22日 10:10
字符串替换 题解:
P2011
回复 0
|
赞 9
|
浏览 917
#include<iostream> #include<string> using namespace std; int main(){ string s; string to = "baibai"; cin>>s; //首先使用tolower()将输入字符串转换为小写。toupper()转换大写 for(int i=0;i<s.size();i++){ ...
1071512987
2024年3月11日 21:52
字符串替换 题解:
P2011
回复 0
|
赞 0
|
浏览 979
java语言,调用String自带函数 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String inStr = in.nextLine();  ...
0980石神
2023年6月28日 17:15
字符串替换 题解:
P2011
回复 0
|
赞 7
|
浏览 1.5k
#include <bits/stdc++.h> using namespace std; int main() { char a[105]={0};//初始串 char b[105]={0};//全部小写串 char c[105]={0};//结果 char x[105] = {'t','a','n','t','a','n'}; &nb...
1
2
题目
字符串替换
题解数量
15
发布题解
在线答疑
热门题解
1
字符串替换 题解:find + replace详细版
2
字符串替换 题解:
3
字符串替换 题解:
4
字符串替换 题解:
5
字符串替换 题解:find+replace
6
字符串替换 题解:
7
字符串替换 题解:
8
字符串替换 题解:C++ find()、replace()实现
9
字符串替换 题解:
10
字符串替换 题解: