点单机上按一个字母:a 是 Milk tea,b 是 Coffee,c 是 Soda。a 和 c 都写好了,补上 b 那一条。这次按的是 b。
Coffee
#include <iostream>
using namespace std;
int main() {
char key = 'b';
switch (key) {
case 'a':
cout << "Milk tea" << endl;
break;
// 在这里写:按 b 的时候显示 Coffee
case 'c':
cout << "Soda" << endl;
break;
}
return 0;
}
写好了先点「运行」试试示例,没问题再点「提交」。