#include <iostream>
using namespace std;
//枚举
enum HeroType
{
Tank,
Magic,
ADC,
Assist
};
int main()
{
//int heroType = 1;
HeroType heroType = Tank;
heroType = ADC;
cout << heroType << endl; // 2
int i = ADC + 2;
cout << i << endl;// 4
heroType = HeroType(3);
cout << heroType << endl; // 3
return 0;
}
#include <iostream>
using namespace std;
//枚举
enum HeroType
{
Tank = 1,
Magic = 4,
ADC = 7,
Assist // 8
};
int main()
{
//int heroType = 1;
HeroType heroType = Tank;
heroType = ADC;
cout << heroType << endl; // 7
int i = ADC + 2;
cout << i << endl;// 9
heroType = HeroType(3);
cout << heroType << endl; // 3
return 0;
}
