4 ms·
A C++ version: #include <iostream> #include <string> int main() { std::string s; while (std::cin >> s) { if (s.size
by tspiteri 16y ago
A C++ version:
#include <iostream>
#include <string>
int main()
{
std::string s;
while (std::cin >> s) {
if (s.size() >= 3 && s.match(s.size()-3, 3, "ing") == 0) {
std::cout << s << '\n';
}
}
}
- pgbovine 16y agowere you trying to make an argument as to how this compares to other languages? (sorry, i don't mean to sound trollish, i'm actually curious as to your intent)
- tspiteri 16y agoIf anything, this particular comment is to show that C and C++ are quite different although they have quite a bit in common.