几种for循环
void ShowReview(const int &x)
{
cout << x << " ";
}
int main()
{
vector<int>book = { 1,2,3,4,5,6 };
vector<int>::iterator pr;
for (pr = book.begin(); pr != book.end(); pr++)
ShowReview(*pr);
cout << endl;
for_each(book.begin(), book.end(), ShowReview);
cout << endl;
for (int x : book)
cout << x << " ";
cout << endl;
for (auto x : book) ShowReview(x);
cout << endl;
}