-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathte.cpp
More file actions
45 lines (39 loc) · 860 Bytes
/
Copy pathte.cpp
File metadata and controls
45 lines (39 loc) · 860 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* =====================================================================================
*
* Filename: te.cpp
*
* Description: i
*
* Version: 1.0
* Created: 2013年02月15日 10时33分34秒
* Revision: none
* Compiler: gcc
*
* Author: 金鹏 (),
* Organization:
*
* =====================================================================================
*/
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
void f(vector< pair<int,int> >& v ){
#define kpart make_pair<int,int>
for( int i = 0 ; i < 10 ; i++ )
{
v.push_back(kpart(i,i)) ;
}
}
void p(pair<int,int>& elem)
{
cout << elem.first <<elem.second<< endl ;
}
int main(int argc, char *argv[])
{
just a test ;
vector<pair<int,int> > v ;
f(v);
for_each(v.begin() , v.end() , p) ;
}