所以程序运行正常,但由于某种原因,在第二次通过时,它完全跳过Console.ReadLine()提示.我经历了调试并确认它不是一个循环问题,因为它实际上正在进入该方法,显示WriteLine然后完全跳过ReadLine,从而返回一个空白回Main()导致它退出.什么是平分?有任何想法吗?
这是代码.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LAB4B
{
class Program
{
static void Main(string[] args)
{
string inString;
ArrayList translatedPhrase = new ArrayList();
DisplayInfo();
GetInput(out inString);
do
{
GetTranslation(inString, translatedPhrase);
DisplayResults(inString, translatedPhrase);
GetInput(out inString);
} while (inString != "");
}
static void DisplayInfo()
{
Console.WriteLine("*** You will be prompted to enter a string of ***");
Console.WriteLine("*** words. The string will be converted into ***");
Console.WriteLine("*** Pig Latin and the results displayed. ***");
Console.WriteLine("*** …Run Code Online (Sandbox Code Playgroud)