![](https://img-blog.csdnimg.cn/20200416171844856.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
STL
STL
Mongo_girl
哈哈哈哈哈哈哈哈
展开
-
string find()函数、string::npos的含义、erase()函数
string::npos参数 —— npos 是一个常数,用来表示不存在的位置例如,有两个字符串a、b,判断a字符串是否包含b字符串//如果字符串不存在包含关系,那么返回值就一定是nposif(a.find(b)!=string::npos){ cout<<"yes"<<endl;}else{ cout<<"no"<<endl...原创 2018-11-04 20:02:48 · 4468 阅读 · 1 评论 -
字符串的查找删除
题目链接:http://www.codeup.cn/problem.php?cid=100000580&pid=2题目描述给定一个短字符串(不含空格),再给定若干字符串,在这些字符串中删除所含有的短字符串。输入输入只有1组数据。输入一个短字符串(不含空格),再输入若干字符串直到文件结束为止。输出删除输入的短字符串(不区分大小写)并去掉空格,输出。样例输入...原创 2018-11-04 20:05:19 · 264 阅读 · 0 评论 -
PAT (Basic Level) Practice — MOOC期终成绩(25)
题目链接:https://pintia.cn/problem-sets/994805260223102976/problems/994805261493977088对于在中国大学MOOC(http://www.icourse163.org/ )学习“数据结构”课程的学生,想要获得一张合格证书,必须首先获得不少于200分的在线编程作业分,然后总评获得不少于60分(满分100)。总评成绩的计...原创 2018-11-26 19:29:24 · 157 阅读 · 0 评论 -
STL—— set
set<int> a;//set定义 set<node> st;//node是结构体类型set<int> a[100]; //set数组 #include<cstdio>#include<set>using namespace std;int main(){ set<int> st; st.inser...原创 2019-02-27 21:44:42 · 135 阅读 · 0 评论 -
STL——vector
一.vector的定义1. 单独定义一个vector:vector<typename> name;typename可以是int、double、char、结构体等,也可以是STL标准容器,但要注意在>>符号之间加空格,否则会被视为移位操作,导致编译错误。vector<char> name;vector<int> name;vec...原创 2019-02-24 16:52:20 · 112 阅读 · 0 评论 -
PAT (Advanced Level) Practice — 1149 Dangerous Goods Packaging (25 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/1038429908921778176When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same contai...原创 2019-02-28 20:36:35 · 148 阅读 · 0 评论 -
PAT (Advanced Level) Practice — 1039 Course List for Student (25 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805447855292416Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the course...原创 2019-02-28 22:55:25 · 187 阅读 · 0 评论 -
PAT (Advanced Level) Practice — 1116 Come on! Let's C (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805355358306304"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejian...原创 2019-02-26 11:36:44 · 161 阅读 · 0 评论 -
PAT (Advanced Level) Practice — 1124 Raffle for Weibo Followers (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805350803292160John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that...原创 2019-02-26 17:12:34 · 113 阅读 · 0 评论