parent
80ffcc3bbf
commit
151c1887c5
@ -0,0 +1,33 @@
|
||||
#include <iostream>
|
||||
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;
|
||||
}
|
Loading…
Reference in new issue