qfedu-basic-level/day7/d6.cpp

30 lines
621 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 输入012三个数值分别代表玩家的角色0代表`亚索`、1代表`盲僧`、2代表`提莫`,输出“您选择的角色为 xxx”。
#include <iostream>
using namespace std;
int main()
{
short n;
cout << "请选择角色: 0-亚索, 1-盲僧, 2-提莫";
cin >> n;
cout << "您选择的角色为: ";
switch (n)
{
default:
cout << "选择错误";
break;
case 0:
cout << "亚索";
break;
case 1:
cout << "盲僧";
break;
case 2:
cout << "提莫";
break;
}
cout << endl;
return 0;
}