answer (первая буква второго слова из Hello world)

#include "stdafx.h" #include <iostream> #include <string> #include <cstdlib> int main() { int count = 0; std::string input = "Hello world"; std::string delimiter = " "; for (int i = 0; i < input.size(); i++) { if (input.at(i) == delimiter.at(0)) count++; if (count == 1) { std::cout << std::endl << input.at(i + 1) << std::endl; break; } } return 0; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.