Skip to content

Commit

Permalink
fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
pezy committed Mar 25, 2015
1 parent e2220a4 commit 2c3c9b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ch03/ex3_17.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main()

for (decltype(vec.size()) i=0; i != vec.size(); ++i)
{
if (i%8 == 0) cout << endl;
if (i != 0 && i%8 == 0) cout << endl;
cout << vec[i] << " ";
}
cout << endl;
Expand Down
2 changes: 1 addition & 1 deletion ch05/ex5_17.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ int main()
auto size = vec1.size() < vec2.size() ? vec1.size() : vec2.size();
for (decltype(vec1.size()) i = 0; i != size; ++i) {
if (vec1[i] != vec2[i]) { cout << "false" << endl; break; }
if (i == size - 1) cout << "ture" << endl;
if (i == size - 1) cout << "true" << endl;
}

return 0;
Expand Down
7 changes: 3 additions & 4 deletions ch11/ex11_3_4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ void ex11_3()
std::map<std::string, std::size_t> word_count;
std::string word;
while(std::cin >> word)
{
++word_count[word];
for (const auto &elem : word_count)
std::cout << elem.first << " : " << elem.second <<"\n";
}

for (const auto &elem : word_count)
std::cout << elem.first << " : " << elem.second <<"\n";
}

int main()
Expand Down

0 comments on commit 2c3c9b3

Please sign in to comment.