#include <iostream>
using namespace std;
int main(){
// enum color2 {
// gray,
// black=3,
// white
// };
// enum color3 {
// gray,
// black=3,
// white
// }a;
enum color1:int16_t {
red,
yellow,
blue
}a,x;
a = red;
cout << "red : " << a << endl;
enum color1 b=yellow;
cout <<"b value :"<<b<<endl;
color1 c = blue;
cout <<"c value :"<<c<<endl;
// color1 d = 1;// c++这个不行
enum class color2{
green,
blue,
red};
color2 e = color2::red; // c++ 11
cout <<"e01 value :"<< static_cast<int>(e)<<endl;
cout <<"e02 value :"<< (int)e<<endl;
for(int d=red;d<=blue;d++){
cout<<d<<endl;
}
return 0;
}