文章
71
粉丝
142
获赞
5
访问
52.5k
#incldue<bits/stdc++.h>
using namespace std;
int main(){
char s[105];
char s_lower[105];
string t = "gzu";
int a[105] = {0};
gets(s);
int m = strlen(s);
int n = t.length();
for(int i=0;i<m;i++){
if(s[i]>='A'&&a[i]<='Z'){
s_lower[i]=s[i]+32;
}else s_lower[i]=s[i];
}
for (int i = 0; i < m; i++) {
int flag = 0;
for (int j = 0; j < n; j++) {
if (t[j] != s_lower[i + j]) {
flag = 1;
&n...
登录后发布评论
#include<bits/stdc++.h>
using namespace std;
int main(){
char s[105];
char s_lower[105];
string t = "gzu";
int a[105] = {0};
gets(s);
int m = strlen(s);
for(int i=0;i<m;i++){
if(s[i]>='A'&& s[i]<='Z'){
s_lower[i]=s[i]+32;
}else {
s_lower[i]=s[i];
}
}
for (int i = 0; i < m; i++) {
int flag = 0;
for (int j = 0; j < 3; j++) {
if (t[j] != s_lower[i + j]) {
flag = 1;
break;
}
}
if (0 == flag) {
for (int k = i; k < 3+i; k++) {
a[k] = 1;
}
}
}
for (int i = 0; i < m; i++) {
if (a[i] == 0) cout << s[i];
}
cout << endl;
return 0;
}
帮你改了一点点
include