Public feed #726180

Mine

public text v1 · immutable
Raw Edit
·published 2007-10-04 22:56 UTC
rendered paste body
#include <iostream>
#include <string>

using namespace std;
 
int main()
{
        char word[25];
	string pigword, pre;

	cout<<"Enter a word to translate to Pig Latin."<<endl;
	cin>>word;

	for (int x = 0; x <= 2; x++)
	{
		switch(word[x])
		{
			case'a':case'e':case'i':case'o':case'u':
				if(x == 1)
				{
					pre[0] = word[0];
				} else if(x == 2) {
					pre[0]=word[0];
					pre[1]=word[1];
				} else if(x == 3) {
					pre[0]=word[0];
					pre[1]=word[1];
					pre[2]=word[2];
				}
				
			cout<<x<<endl;

			for(int i = 0; i <= 15; i++)
			{
				pigword[i-x] = word[i];
				break;
			}
		}
		cout<<pigword<<endl;
	}

}