1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| #include<iostream> using namespace std; int main() { bool quit=false; for(;;) { char choice; cout << "(0)零(1)壹(2)贰(3)叁(4)肆(5)伍(6)陆(7)柒(8)捌(9)镹(q)退出:"; cin >> choice; switch (choice) { case '0': cout << "您输入的是零"; break; case '1': cout << "您输入的是壹"; break; case '2': cout << "您输入的是贰"; break; case '3': cout << "您输入的是叁"; break; case '4': cout << "您输入的是肆"; break; case '5': cout << "您输入的是伍"; break; case '6': cout << "您输入的是陆"; break; case '7': cout << "您输入的是柒"; break; case '8': cout << "您输入的是捌"; break; case '9': cout << "您输入的是镹"; break; case 'q': quit=true; break; default: cout << "您输入的不是0到9之间的有效数字。"; } if(quit==true){ break; } } cout <<endl<< "程序执行结束" << endl; return 0; }
|