Hi!
I need to write a program that moves some letters to the end of a word for example if i enter : cook look book telephone, the result would be: ookc ookl ookb elephonet.
i came up with some code but then my ideas run aout...some help would be appreciated =)
My code so far:
#include "stdafx.h"
#include <conio.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
string txt;
{
cout <<"Enter string"<<endl;
getline(cin,txt);
}
for (int i=0; i<int(txt.size()); ++i)
{
if (txt[i]=='a' || txt[i]=='e' || txt[i]=='i' || txt[i]=='o' || txt[i]=='u')
cout<<txt[i];
}
for (int j=0; j<int(txt.size()); ++j)
{
if (txt[j]=='q' || txt[j]=='w' || txt[j]=='r' || txt[j]=='t' || txt[j]=='y' || txt[j]=='p'
|| txt[j]=='s' || txt[j]=='d' || txt[j]=='f' || txt[j]=='g' || txt[j]=='h' || txt[j]=='j'
|| txt[j]=='k' || txt[j]=='l' || txt[j]=='z' || txt[j]=='x' || txt[j]=='c' || txt[j]=='v'
|| txt[j]=='b' || txt[j]=='n' || txt[j]=='m')
cout<<txt[j];
}
getch();
return 0;
}