#include #include using namespace std; int main() { string hello = {"Hello World 123 $%!"}; int pos; string first, second; int i; cout << "The string is \"" << hello << '"' << endl; cout << "It contains " << hello.size() << " characters." << endl; pos = hello.find(" "); cout << "The first space is at position " << pos << endl; cout << endl; first = hello.substr(0, pos); second = hello.substr(pos+1, string::npos); cout << "The first string is \"" << first << '"' << endl; cout << "The second string is \"" << second << '"' << endl; cout << endl << endl; i = 0; while (i < hello.size() ) { //cout << i << " " << hello[i] << endl; cout << i << " " << hello.at(i) << endl; i++; } cout << endl << endl; i = 0; while(i < hello.size()) { hello.at(i) = toupper(hello.at(i)); i++; } i = hello.size() - 1; while (i >= 0 ) { cout << hello[i]; i--; } cout << endl << endl; return 0; }