完成 switch
语句,并在末尾添加正确的**关键字**,以指定在 switch
语句中没有匹配的 case 时要运行的代码。
int day = 4; switch (@(3)) { @(4) 1: cout << "Saturday"; break; @(4) 2: cout << "Sunday"; @(5); @(7): cout << "Weekend"; }
int day = 4; switch (day) { case 1: cout << "Saturday"; break; case 2: cout << "Sunday"; break; default: cout << "Weekend"; }