// If statement, User input is executed
if (userInput == "k")
{
// User enters their statement
Console.WriteLine("Enter your statement");
myScen = Convert.ToString(Console.ReadLine());
句号代码
// Does the sentence end with a full stop?
if (myScen.EndsWith("."))
Console.WriteLine("\n\tSentence Ended Correctly");
else
Console.WriteLine("Invalid Sentence");
这里需要一个停止命令。这是它不会停止并继续计算数字的地方
// Calculate number of characters
foreach (char c in myScen)
{
numbChar++;
if (c == ' ')
continue;
newScen += c;
}
Console.WriteLine("\n\tThere are {0} characters. \n\n\n",numbChar);
}