Given a string, an integer position, and an integer length, all on separate lines, output the substring from that position of that length.
Ex: If the input is:
Fuzzy bear
3
4
the output is:
zy b
Note: Using a pre-defined string function, the solution can be just one line of code. It does not have to be one line though it can be a lot.
Code:
#include
#include
using namespace std;
int main() {
string workStr;
int indexBegin;
int len;
getline(cin, workStr);
cin >> indexBegin;
cin >> len;
/* Your code goes here */
return 0;
}