我想要
Console.WriteLine("Please enter a day of the week, e.g. Tue: ");
today = Console.ReadLine();
GotoWork = string (today != SUN && today != SAT) ?
Console.WriteLine("You have to go to work today...") ;
Console.WriteLine("Ahh... the weekend. No work!");'
编译并告诉我是否需要去上班,但它告诉我'(今天!= SUN&& today!= SAT)'是
invalid expression term for string.
答案 0 :(得分:0)
用双引号SUN
和SAT
换行,因为这是表示字符串的方式。
today != "SUN" && today != "SAT"