首页
DreamJudge
院校信息
考研初试
机试真题
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
13639360392
2022年3月13日 10:38
指针法(高效、无需无意义的运算)
P1027
回复 0
|
赞 0
|
浏览 6.2k
#include #include #include int main() {int i=0,j=0; char *s,a[]="gzu",b[100]; char *p,*q; s=(char *)malloc(sizeof(char)* 20); gets(s); while(*s!=0) { p=s; q=a; while((*p==*q)&&*q!=0) ...
鱼翔浅底
2021年1月17日 21:37
删除字符串2(C)
P1027
回复 0
|
赞 1
|
浏览 10.5k
#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { char s[105]; int len; gets(s); len=strlen(s); int i=0,j=-1; while (i<len-2) { if ((s[i]=='G'||s[i]=='g')&& (s[i+1]=='Z'||s[...
老猫
2021年1月12日 15:50
简洁
P1027
回复 0
|
赞 3
|
浏览 9.1k
#include <bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int len=s.size(); int a[100]={0}; for(int i=0;i<len-2;i++) if(tolower(s[i])=='g'&&tolower(s[i+1])=='z'&&tolower(s[i+2])=='u') { a[i]=1;a[i+1]=1;a[i+2]=1; } for...
A1120161820
2020年3月23日 10:45
删除字符串2(c++)
P1027
回复 0
|
赞 1
|
浏览 9.4k
#include<iostream> #include<string> using namespace std; int main() { string s1, s2 = ""; cin >> s1; int i = 0; while (s1[i]) { if (i < s1.length()-2) { if (s1[i] == 'g' || s1[i] == 'G') { if (s1[i+1] == 'z' || s1[i+1] == 'Z') { if (s1[i+2] == ...
莫小七
2020年2月24日 12:54
1027字符串删除2(用string函数)
P1027
回复 0
|
赞 3
|
浏览 10.5k
#include<iostream> #include<cstring> #include<string> #include <algorithm> using namespace std; int main() { string str,str1; cin >> str; str1 = str; int pos = 0; transform(str1.begin(), str1.end(), str1.begin(), ::tolower); //cout << str...
myhy001
2019年12月6日 10:33
删除字符串2
P1027
回复 1
|
赞 0
|
浏览 10.2k
#include<stdio.h> int main() { char a[80]; int i; gets(a); i=0; while(a[i]!='\0') { if(a[i]=='G'||a[i]=='g') {  ...
创世的背影
2019年12月12日 00:17
删除字符串2(多加几个或就好)
P1027
回复 0
|
赞 0
|
浏览 9.7k
#include<stdio.h> #include<string.h> int main() { char a[100],b[100]; int n,i,j; gets(a); n=strlen(a); j=0; for(i=0;i<n;i++) { if(a[i]=='g...
LiW97
2020年2月6日 18:30
正确输入与输出,不管oj数据通过率只有50
P1027
回复 2
|
赞 0
|
浏览 11.0k
#include int main(){ char s[99]={0}; char s_[99]={0}; scanf("%s",s); int i=0; int j=0; int flag=0; while(s[i]!=EOF){ if(s[i]=='G'||s[i]=='g') if(s[i+1]=='Z'||s[i+1]=='z') &nbs...
Jeff_zhu
2020年2月13日 23:26
复杂度O(N),直接输出
P1027
回复 1
|
赞 3
|
浏览 10.8k
#include using namespace std; int main() { // freopen("1.txt", "r", stdin); string s; while(cin >> s) { int size = s.size(); int i; //扩充防止遍历越界 s += " "; for(i = 0; i < size; i++) { if(!((s[i] == 'g' || s[i] =...
1
...
3
4
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 题解: