-
Notifications
You must be signed in to change notification settings - Fork 0
/
testing.cpp
54 lines (47 loc) · 938 Bytes
/
testing.cpp
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
46
47
48
49
50
51
52
53
54
#include<iostream>
#include<list>
#include<vector>
#include<stdlib.h>
using namespace std;
int a[10]={7,2,3,4,5,6,7,8,9,10};
int b[10]={10,11,12,13,14,15,161,17,7,10};
bool Constrain(int a,int b){
if(b-a<10)
return true;
else
return false;
}
void trace(bool(*fp)(int,int)){
vector<list<int>> v;
//for(int i=0;i<10;i++){
for(int j=0;j<10;j++){
list<int> pos;
pos.push_back(a[0]);
if(Constrain(a[0],b[j])){
cout<<b[j]<<"\r\n";
pos.push_back(b[j]);
v.push_back(pos);
}
}
//}
cout<<"***********************\r\n";
vector<list<int>>::iterator i=v.begin();
for(;i!=v.end();i++){
list<int>::iterator j=(*i).begin();
for(;j!=(*i).end();j++){
cout<<*j<<endl;
}
}
}
/*int main(){
list<int> v;
v.push_back(1);
v.push_back(2);
v.push_back(3);
v.push_back(4);
list<int>::iterator i=v.begin();
for(;i!=v.end();i++)
cout<<*i;
trace(Constrain);
return 0;
}*/