uva
文章平均质量分 64
galaxygalaxygalaxy
这个作者很懒,什么都没留下…
展开
-
UVA 1593 stringstream用法
先用getline(cin,line),再用stringstream输入 记录最长的单词的长度,输出时注意空格数量 #include <bits/stdc++.h> using namespace std; int main(){ int line_cnt=0,word_size[200]; vector<string> all[1005]; string line,.原创 2019-02-01 19:22:24 · 139 阅读 · 0 评论 -
uva 10763 map基本用法
map基本用法 .clear(), .empty(), .insert(), .size(), .erase() 用map<pair<int,int>,int>,建立两个相反的pair,如果一致,就清除 #include <bits/stdc++.h> using namespace std; int main(){ int n; map<原创 2019-02-03 18:00:29 · 138 阅读 · 0 评论 -
uva 10391 find(),substr()使用方法
substr(pos,len) 从pos开始len个字符 substr(pos) 默认到结尾 vector没有find功能,其他常见STL都有,返回迭代器 find()功能,如果迭代器指向最后一个元素说明原来不包含这个词 se.find(str1)!=se.end() #include <bits/stdc++.h> using namespace std; int main(){ ...原创 2019-02-03 22:23:45 · 76 阅读 · 0 评论