#include <iostream>
int main(void) {
using std::cout;
using std::endl;
enum ultraman {
TIGA,
DYNA,
GAIA,
AGUL = 2000,
COSMOS,
MEBIUS,
};
// name 只能被赋值 ultraman 里面的单词, 这里面的单词虽然可以转换成int类型,
// 但int类型不能转换成name里面的枚举类型
ultraman name;
name = TIGA;
cout << name << endl;
int a = DYNA + 8;
cout << a << endl;
}
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交