namespace ProgrammingTesting
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please enter the input");
string input1 = Console.ReadLine();
if (input1 == "4")
{
Console.WriteLine("You are a winnere");
Console.ReadLine();
}
else if (input1.Length < 4)
{
Console.WriteLine("TOOOOO high");
}
else if (input1.Length > 4)
{
Console.WriteLine("TOOOO Low");
Console.ReadLine();
}
}
}
}
如果我輸入的數字小於4,爲什麼程序不輸出「太低」。比較字符串長度和字符串值之間的區別
類型'12345'看到'Tooo Low' – I4V 2013-02-23 12:30:23
你想測試輸入的字符串的長度,或輸入數字的數值? – nnnnnn 2013-02-23 12:31:55
你想做什麼?少於4個符號或少於輸入4? – 2013-02-23 12:32:34