1 2 3 4 5 6 7 8 9 10 11
#include <iostream> #include <string> using namespace std; int main() { string s = "ABCDEFGHIJKMLOMNPQRSTUWXYZ"; cout << s.substr(0, 5) << endl; cout << s.substr(2, 2) << endl; return 0; }
1 2
ABCDE CD