首页
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
爱学习的小妞
2025年3月18日 16:48
查找 - 北邮 题解:WA50%求解
P1387
回复 2
|
赞 6
|
浏览 136
#include <bits/stdc++.h> #include <algorithm> using namespace std; void oper_0(string &a,int x,int y) { for(int i=x;i<=(x+y-1)/2;i++) { char temp=a[i]; a[i]=a[x+y-i-1]; &n...
zxjrheaven
2025年3月14日 23:23
查找 - 北邮 题解:暴力,拼尽全力终于战胜
P1387
回复 0
|
赞 1
|
浏览 150
#include <bits/stdc++.h> using namespace std; string fanzhuan(string str,char a,char b,int c) { char str2[c]={0}; int t=(a-'0')+(b-'0')-1; for(int i=a-'0';i<a-'0'+b-'0';i++) &n...
seventeen
2025年3月13日 19:18
查找 - 北邮 题解:
P1387
回复 0
|
赞 4
|
浏览 134
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<map> #include<queue> using namespace std; int main() { string s; cin >> s; int n; &nbs...
可可爱爱草莓派
2024年8月30日 17:48
比较笨
P1387
回复 0
|
赞 19
|
浏览 1.7k
#include<bits/stdc++.h> using namespace std; string op1(string op,string sss){//翻转 int n = sss.size(); int i = op[1] - '0',len = op[2] - '0';//i起始下标,len操作的长度 string ss = sss.substr(i,i + len); reverse(ss.begin()...
23hg
2024年7月23日 17:56
查找 - 北邮 题解:替换部分求问
P1387
回复 1
|
赞 9
|
浏览 675
完整已AC的代码附在最后!!!! ---------------------先问一个关于替换部分的问题---------------------- 以下实现替换部分的代码只有33%的通过率 int t = 0; string rep = op.substr(3, op.size()); for (int j = i; j <= i + len - 1; j++) { s[j] = rep[t++]; } 更换成如下代码,就百分百通过: string r...
Yangyylj
2021年5月19日 22:22
字符串函数的使用:reverse() 翻转;substr()获取子串;
P1387
回复 1
|
赞 45
|
浏览 9.2k
s.substr(p, n) 返回从s的下标p开始的n个字符组成的字符串 s.replace(p0, len0, s2, pos, len) 删除p0开始的len0个字符,然后在p0处插入串s2中从pos开始的len个字符 #include<bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ int n; cin >> n; while(n--)...
遨游
2024年3月17日 21:59
查找 - 北邮 题解:求大佬看看哪儿有问题,始终只有33%的通过率
P1387
回复 4
|
赞 20
|
浏览 1.3k
#include <iostream> #include <string> using namespace std; int main(){ string str; int n; while(cin>>str){ cin>>n; string s; ...
LHXLLLLL
2024年3月15日 11:14
查找 - 北邮 题解:过了,替换长度可能不一样,用到了string的e
P1387
回复 1
|
赞 7
|
浏览 1.2k
#include<bits/stdc++.h> using namespace std; void reverse(string &s, int begin, int end) { for (int i = begin, j = end; i < j; i++,j--) { swap(s[i],s[j]); } } int main() { string str; while (cin>>str) { int n; cin>>n; for (int i = 0; i ...
18237466773
2024年3月13日 10:45
查找 - 北邮 题解:通过率只有33%,求佬帮忙看一下,是不是思路有问
P1387
回复 2
|
赞 4
|
浏览 665
#include<bits/stdc++.h> using namespace std; int main() { char s[105]; int n; while(~scanf("%s",&s)){ scanf("%d",&n); st...
1935569240
2024年3月6日 11:33
查找 - 北邮 题解:简单代码来了哦
P1387
回复 0
|
赞 3
|
浏览 952
#include<iostream> #include<algorithm> #include<string> using namespace std; int main() { string str; while (getline(cin, str)) { int n,cnt=0; string ans[...
1
2
题目
查找 - 北邮
题解数量
17
发布题解
在线答疑
热门题解
1
字符串函数的使用:reverse() 翻转;substr()获取子串;replace()进行字符串替换
2
查找 - 北邮 题解:求大佬看看哪儿有问题,始终只有33%的通过率
3
比较笨
4
C++,偷懒简洁高效版,直接用reverse()、replace()函数一步搞定字符串的翻转和替换
5
查找 - 北邮 题解:替换部分求问
6
查找 - 北邮 题解:过了,替换长度可能不一样,用到了string的erase函数和insert函数
7
查找 - 北邮 题解:WA50%求解
8
查找 - 北邮 题解:通过率只有33%,求佬帮忙看一下,是不是思路有问题
9
查找 - 北邮 题解:
10
查找 - 北邮 题解:简单代码来了哦