اريد معرفة ماهى المشكلة فى هذا الكود لو سمحت؟؟
I would like someone to tell me what is the problem in this C# code
using System;
namespace PigLatin
{
class Pig
{
public static void Main(string[] args)
{
string pigWord;
string sentence;
string firstLetter;
string restOfWord;
string vowels = "AEIOUaeiou";
int letterPos;
while (sentence.ToLower() != "quit"){
Console.WriteLine ("Please enter a sentence (or type \"quir\"to exit.)");
sentence = Console.ReadLine();
}
foreach (string word in sentence.Split());
firstLetter = word.Substring (0,1);
restOfWord = word.Substring (1,word.Length -1);
letterPos = vowels.IndexOf (firstLetter);
if (letterPos == -1){
//its a consonant
pigWord = restOfWord + firstLetter + "ay";
}
else {
//its a vowel
pigWord = word + "way";
}
Console.Write ("{0}",pigWord);
}
}
}و شكرا لتعاونكم :)