CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
https://www.sololearn.com/Discuss/994796/?ref=app
Challenge Task:
Split input string into parts when a character was found to be different with the previous one.
© 2018 SoloLearn Community
*/
#include <string>
#include <iostream>
int main()
{
std::string input;
// Get input, and use default sample if
// the input was empty.
std::cout << "Enter a word or sentence: ";
std::getline(std::cin, input);
if(input.empty())
{
input = "AaaabbbbYY@---..aaaa\r\n\t\f\v 555%%%%(((f)))";
std::cout << "(Use default)";
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run