//Using a list to sort a sequence of 9 numbers. #include #include using namespace std; void print(list a);//utility function print lists of ints int main() { list a; //Put 9,8,7,6,5,4,3,2,1 onto the list for(int i=0; i<9;++i) a.push_back(9-i);// put new element after all the others print(a); //here the list contains (9,8,7,6,5,4,3,2,1) a.sort();//in the library! print(a); //here the list contains (1,2,3,4,5,6,7,8,9) } void print( list a) { for(list::iterator ai=a.begin(); ai!=a.end(); ++ai) cout << *ai << " "; cout << endl; cout << "----------------"<