-4

我试图得到

 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.
4

1 回答 1

0

用双引号括起来SUNSAT因为这是字符串的表示方式。

today != "SUN" && today != "SAT"
于 2013-10-19T17:10:57.837 回答