#include<iostream>
using namespace std;
int main()
{
//a) Delete " Game " resulting " over!!! "
string phrase=" Game Over?!!! ";
cout<<"Primary frase ="<<phrase<<endl;
phrase.erase(1,6);
phrase.erase(4,1);
phrase.insert(1,"o");
cout<<"Phrase a ="<<phrase<<endl;
//b) Delete "Game r!!! " resulting " ave "
phrase=" Game Over?!!! ";
phrase.erase(1,6);
phrase.erase(3,5);
phrase.insert(1,"a");
cout<<"Phrase b ="<<phrase<<endl;
//c) Delete " G ove " resulting " ame r!!! "
phrase=" Game Over?!!! ";
phrase.erase(1,1);
phrase.erase(5,3);
phrase.erase(6,1);
cout<<"Phrase c ="<<phrase<<endl;
}
Comments
Leave a comment