Source:






Result:

[work@db-testing-com06-vm3.db01.baidu.com c++]$ g++ -o list list.cpp

[work@db-testing-com06-vm3.db01.baidu.com c++]$ ./list

listOne.begin()--- listOne.end():

1 2 3 4

listOne.rbegin()---listOne.rend():

4 3 2 1

Sum=10

listTwo.begin()---listTwo.end():

B A x y

The maximum element in listTwo is: y

原文: C++list