#include <iostream>
#include <string>
using namespace std;
int getIndex(string message){
for (int i = 0;i< message.length(); ++i) {
if (tolower(message[i]) == 'a' ||
tolower(message[i]) == 'e' ||
tolower(message[i]) == 'i' ||
tolower(message[i]) == 'o' ||
tolower(message[i]) == 'u') {
return i;
}
}
return -1;
}
int main () {
string message="";
string newMessage="";
cout<<"Enter string: ";
getline(cin,message);
int index=getIndex(message);
if(index!=-1){
for (int i = index;i< message.length(); ++i) {
newMessage+=message[i];
}
for (int i =0;i<index; ++i) {
newMessage+=message[i];
}
}
cout<<"\nUpdated string: "<<newMessage<<"\n\n";
system("pause");
return 0;
}
Comments
Leave a comment