#include "stdafx.h"
#include <iostream>
#include <string>
#include <cstdlib>
int main()
{
int count = 0;
std::string input;
std::string delimiter;
std::cout << std::endl << "Delimiter =";
getline(std::cin, delimiter);
std::cout << std::endl << "String =";
getline(std::cin, input);
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.