Skip to content

Commit

Permalink
Update ex10_01_02.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooophy authored and pezy committed May 26, 2015
1 parent 0b876b4 commit bf71724
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions ch10/ex10_01_02.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,13 @@

int main()
{
//! Exercise 10.1
std::vector<int> v{1,2,3,4,5,6,6,6,2};
std::cout << "ex 10.01: "
<< std::count(v.cbegin(), v.cend(), 6)
<< std::endl;
//! 10.1
std::vector<int> v = { 1, 2, 3, 4, 5, 6, 6, 6, 2 };
std::cout << "ex 10.01: " << std::count(v.cbegin(), v.cend(), 6) << std::endl;

//! Exercise 10.2
std::list<std::string> ls = {"aa","aaa","aa","cc"};
std::cout << "ex 10.02: "
<< std::count(ls.cbegin(), ls.cend(), "aa")
<< std::endl;
//! 10.2
std::list<std::string> l = { "aa", "aaa", "aa", "cc" };
std::cout << "ex 10.02: " << std::count(l.cbegin(), l.cend(), "aa") << std::endl;

return 0;
}
Expand Down

0 comments on commit bf71724

Please sign in to comment.