完成 switch
语句,并在最后添加正确的 **关键字** 以指定如果 switch
语句中没有匹配的 case 应该运行哪些代码。
int day = 3; switch (@(3)) { @(4) 1: Console.WriteLine("Today is Saturday"); break; @(4) 2: Console.WriteLine("Today is Sunday"); @(5); @(7): Console.WriteLine("Looking forward to the Weekend"); @(5); }
int day = 3; switch (day) { case 1: Console.WriteLine("Today is Saturday"); break; case 2: Console.WriteLine("Today is Sunday"); break; default: Console.WriteLine("Looking forward to the Weekend"); break; }