Required header files
#include<string>
Other things needed
using namespace std;
substr(pos,len) returns a substring of length len starting from the pos number position, and the time complexity is O(len)
It is very convenient to use it to output all the strings of a string.