1092. To Buy or Not to Buy (20)
2017-02-23 14:05
323 查看
假题
#include<iostream> #include<string> using namespace std; int main() { string str1, str2; cin >> str1 >> str2; int cnt = 0; for (auto x : str2) { auto te = str1.find(x); if (te < str1.size()) str1.erase(te, 1);//找到删掉主串的字符 else cnt++;//未找到,缺的+1 } if (cnt != 0) cout << "No " << cnt << endl; else cout << "Yes " << str1.size() << endl; }
相关文章推荐
- 1092. To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)
- 1039. 到底买不买(20) PAT 乙级&&1092. To Buy or Not to Buy (20)PAT甲级
- 1092. To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)【水题】——PAT (Advanced Level) Practise
- 1092. To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)
- PAT(甲级)1092. To Buy or Not to Buy (20)
- PAT (Advanced Level) Practise 1092 To Buy or Not to Buy (20)
- PAT (Advanced Level) Practise 1092 To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)
- 1092. To Buy or Not to Buy (20)