首页
DreamJudge
院校信息
考研初试
机试真题
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
leo110
2025年5月8日 13:31
删除字符串2 题解:思路:先转换成小写,找到位置后把原字符串的对应位置
P1027
回复 0
|
赞 0
|
浏览 122
#include<iostream> #include<string> #include<vector> #include<sstream> using namespace std; //思路:先转换成小写,找到位置后把原字符串的对应位置置为空格,再模仿cin输入流,将多个字符串拼接 int main(){ string str,s,mode="gzu"; cin>>str;  ...
16696033405
2025年3月24日 17:42
删除字符串2 题解:
P1027
回复 0
|
赞 3
|
浏览 349
#include <stdio.h> #include <string.h> #include <ctype.h> #define MAX 1000 int main() { char s[MAX], result[MAX]; int i = 0, j = 0; // 读取输入 fgets(s, MAX, stdin); s[strcspn(s, "\n")] = ...
123456上岸
2025年3月17日 20:16
删除字符串2 题解:
P1027
回复 0
|
赞 11
|
浏览 481
#include<iostream> #include<string> using namespace std; int main(){ string s; cin>>s; int flag = 1; while(flag){ int t=-1; //记录出现“gzu”下标 ...
cc12345
2025年3月17日 10:41
删除字符串2 题解:后值覆盖gzu,判断数目再输出。
P1027
回复 0
|
赞 12
|
浏览 528
#include<bits/stdc++.h> using namespace std; int main(){ string s; getline(cin,s); int len=s.length(); int num=0; for(int i=0;i<len-3;i++) { if((s[i]=='G'||s[i]=='g')&&(s[i+1]=='Z'||s[i+1]=='z')&&(s[i+2]=='U'||s[i+2]=='u')) { num+=3; for(int j=i;j<len-...
ASDF807
2025年3月15日 15:47
删除字符串2 题解:C
P1027
回复 0
|
赞 11
|
浏览 442
#include<stdio.h> #include<string.h> int main() { char str[100]; fgets(str,101,stdin); int len = strlen(str)-1; for(int i=0;i<len;i++) { if((str[...
阿灿
2025年3月15日 06:09
删除字符串2 题解:直接八种情况上
P1027
回复 0
|
赞 3
|
浏览 363
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; while(s.find("gzu")!= string::npos){ s.erase(s.find("gzu"),3); } while(s.find("Gzu")!= string::npos){ s.erase(s.find("Gzu"),3); } while(s.find("GZU")!= string::npos){ s.erase(s.find("...
blackbook537
2025年3月13日 11:14
删除字符串2 题解:memmove加strncasecmp
P1027
回复 0
|
赞 1
|
浏览 380
#include<stdio.h> #include<string.h> #include<ctype.h> char *strcasestr(const char *haystack, const char *needle){ if(!*needle) return (char *)haystack; size_t needle_len = strlen(needle); for(; ...
cccccuda
2025年3月12日 21:27
删除字符串2 题解:复制一份转小写
P1027
回复 0
|
赞 4
|
浏览 379
#include <iostream> using namespace std; int main() { string s; getline(cin,s); string cpy=s; //将s全部转化为小写 for(int i=0; i<s.size(); i++) { if(s[i]>='A'&...
诗岸梦行舟
2025年3月11日 20:22
删除字符串2 题解:不考虑新组合,del[i]存储跳跃点
P1027
回复 0
|
赞 4
|
浏览 577
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ char s[1001]; gets(s); int n=strlen(s); int del[1001]; int deli=0; for(int i=0;i<n;i++){ if( (s[i+2]=='U'||s[i+2]=='u')&& (s[i+1]=='Z'||s[i+1]=='z')&& (s[i]==...
xddddddddddddd
2025年3月10日 13:29
删除字符串2 题解:方法二:不考虑删除后是否出现新组合
P1027
回复 0
|
赞 3
|
浏览 346
#include<iostream> #include<string> using namespace std; int main(){ string s; cin >> s; for(int i=0;i<s.length();i++){ //逻辑短路避免越界 &nbs...
1
2
3
...
5
题目
删除字符串2
题解数量
49
发布题解
在线答疑
热门题解
1
删除字符串2 题解:C
2
简单易懂
3
删除字符串2 题解:
4
删除字符串2 题解:
5
删除字符串2 题解:后值覆盖gzu,判断数目再输出。
6
删除字符串2 题解:
7
删除字符串2 题解:C
8
删除字符串2 题解:C++
9
删除字符串2 题解:
10
删除字符串2 题解: