由于某种原因,这部分对我来说很难。其他一切都很好,但我似乎无法弄清楚如何让它重新询问输入是否> = 2 ...
if (minimumSides >= 2)
我得到这部分,但它讨厌minimumsides >= 2.
do
{
Console.Write("Enter minimum number of sides >2: ");
int.TryParse(inputminside, out minimumSides);
if (minimumSides >= 2)
Console.Write("Enter minimum number of sides >2: ");
else
inputminside = Console.ReadLine();
}
while (!int.TryParse(inputminside, out minimumSides));