【发布时间】:2013-10-19 17:03:00
【问题描述】:
我正在努力
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!");'
编译并告诉我是否需要上班,但它告诉我'(today != SUN && today != SAT)' 是一个
invalid expression term for string.
【问题讨论】:
-
将
SUN更改为"SUN",与SAT相同,并阅读有关C# 语法的更多信息。
标签: c# if-statement compiler-errors