可能重複: Why does the C++ standard algorithm 「count」 return a ptrdiff_t instead of size_t? 有算法std::count/std::count_if在標準C++。 template<class InputIterator, class T>
typename iterator_traits<InputIterato
這個問題已經在SO中完成了死亡。這裏是我的版本,使用傳統算法的STL函數來反轉字符串,然後翻轉單詞。有沒有使用循環更優雅的soln? std::string something;
std::getline(std::cin, something);
std::reverse(something.begin(), something.end());
for (size_t i = 0, siz