随笔分类 -  STL

摘要:在写私信群聊代码的时候碰到怎么把一个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 阅读(1007) 评论(0) 推荐(0)

摘要: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 阅读(617) 评论(0) 推荐(0)

导航