#include using namespace std; // C++入门经典-例3.13-不加break的switch判断语句 // https://blog.csdn.net/lovemi93/article/details/90702825 int main() { char c; while (1) { cin >> c; if (c == 'q') break; switch (c) { case 'A': cout << "1 "; break; case 'B': cout << "3 "; case 'C': cout << "3 "; case 'D': cout << "Here!"; cout << "5 "; break; case 'E': cout << "5 "; break; default: cout << "9 " << endl; } cout << endl; } return 0; }