Given a problem(see attachment) And the program, Fill up the blank spaces in the program in order to make the program work correctly.
------------------------------------------------------------
PLACE TO FILLUP THE BLANK SPACES IN THE PROGRAM BELOW AT LINES NUMBER:- ( 11 , 19 , 25 , 29 , 35 , 39 )
1 #include <iostream> 2 #include <set> 3 #include <list> 4 using namespace std; 5 int main() { 6 int s1,v1,s2,v2; 7 cout<<"Enter the number of values in list 1"<<endl; 8 cin>>s1; 9 cout<<"Enter the values"<<endl; 10 set<int> set1;
11 for( _______ )
{ 12 cin>>v1; 13 set1.insert(v1); 14 } 15 cout<<"Enter the number of values in list 2"<<endl; 16 cin>>s2; 17 cout<<"Enter the values"<<endl; 18 set<int> set2;
19 for(_____________)
{ 20 cin>>v2; 21 set2.insert(v2); 22 } 23 cout<<"Set 1"<<endl; 24 set<int>::iterator it;
25 for(_________)
26 cout << *it <<endl; 27 cout<<"Set 2"<<endl; 28 set<int>::iterator it1;
29 for(___________)
30 cout << *it1 <<endl; 31 cout<<"Union"<<endl; 32 set1.insert(set2.begin(), set2.end()); 33 list<int> list1; 34 set<int>::iterator sit;
35 for(_________)
36 list1.push_front(*sit); 37 list1.sort(); 38 list <int> :: iterator itr;
39 for(___________)
40 cout << *itr <<endl; 41 }
|