首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
mlx
2026年3月23日 17:10
字符串的差 题解:
P1832
回复 0
|
赞 1
|
浏览 66
#include<iostream> #include<map> using namespace std; string a,b; map<char,int> m; int main() { cin>>a>>b; if(a.size()<b.size()) swap(a,b); for(auto c:b) m[c]=1; string res=""; for(int i=0;i<a.size();i++) if(!...
曾不会
2026年2月7日 19:29
这题目不清楚,还以为删一次呢,原来是全删,那就用简单啦
P1832
回复 0
|
赞 2
|
浏览 287
s1=input() s2=input() for i in s1: if i in s2: continue else: print(i,end='')
yauqq
2026年1月30日 17:11
字符串的差 题解:
P1832
回复 0
|
赞 13
|
浏览 268
#include <bits/stdc++.h> using namespace std; int main(){ string str1,str2; cin >> str1 >> str2; for(char &c:str2){ while(str1.find(c)!= string::npos){ int pos = str1.find(c); str1.erase(pos,1); } } cout << str1; return 0; }
RingoCrystal
2025年2月19日 14:34
字符串的差 题解:按照t里面把s的全部一样的都删完
P1832
回复 0
|
赞 22
|
浏览 1.2k
#include <bits/stdc++.h> using namespace std; int main(){ string s,t; while(cin>>s>>t){ for(auto x:t){ for(int i=0;i<s.size();i++){ if(s[i]==x){ s.erase(i--,1); } } ...
中国人民万岁
2024年3月23日 23:04
字符串的差 题解:删除a中重复后进行字符串移动 已更新100% a中字
P1832
回复 2
|
赞 3
|
浏览 1.4k
#include <bits/stdc++.h> using namespace std; int main() { string a, b; getline(cin, a); getline(cin, b); int na = a.size(); int nb = b.size(); int cnt = 0; &...
小王桐学
2024年2月28日 22:06
字符串的差 题解:C
P1832
回复 0
|
赞 7
|
浏览 1.5k
#include <stdio.h> #include <string.h> int main() { int i,j,flag; char s[1000],t[1000]; gets(s); gets(t); for(i = 0; i < strlen(s); i++) { j = 0; flag = 0; while(j < strlen(t)) { if(s[i] == t[j]) { flag = 1; break; } j++...
James
2021年3月20日 21:00
这里的删除是指b中有的字符a中不能出现
P1832
回复 0
|
赞 5
|
浏览 9.4k
#include <iostream> #include <algorithm> #include <stack> #include <string.h> #include <stdio.h> #include <queue> #include <math.h> using namespace std; string a,b; int vis[26]; int main(){ cin>>a>>b;  ...
题目
字符串的差
题解数量
7
发布题解
在线答疑
热门题解
1
字符串的差 题解:按照t里面把s的全部一样的都删完
2
字符串的差 题解:
3
字符串的差 题解:C
4
这里的删除是指b中有的字符a中不能出现
5
字符串的差 题解:删除a中重复后进行字符串移动 已更新100% a中字符删除后直接跳到a的下一个字符,避免重复删除造成移动
6
这题目不清楚,还以为删一次呢,原来是全删,那就用简单啦
7
字符串的差 题解: