随笔分类 -  STL

stl algorithm -- sort ,unique
摘要:在写私信群聊代码的时候碰到怎么把一个vector<Int> 元素unique化的问题,基本上就是需要下面这么做,用<algorithm>中的,先sort再unique 1 #include <algorithm> 2 #include <iostream> 3 #include <vector> 4 #include <stdio.h> 5 using namespace std; 6 void print(vector<int>& vec); 7 int main(){ 8 int a[] = {1, 阅读全文

posted @ 2012-06-11 19:37 小宇2 阅读(999) 评论(0) 推荐(0) 编辑

std IO库, stringstream, 简看1
摘要:IO Stream Library : Standard Input Output Stream Library, 这是一个面向对象的库, 用流的方式提供input,output功能写了一个关于stringstream的小测试程序 1 #include<string> 2 #include<iostream> 3 #include<sstream> 4 using namespace std; 5 int main () 6 { 7 stringstream ss; 8 int i1 = 123; 9 ss << i1;10 string str 阅读全文

posted @ 2012-05-24 20:10 小宇2 阅读(605) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示