下面对枚举变量的定义中,正确的是( )。
A: enum color {red, blue, grenn} a, b;
B: enum color={red, blue, green} a,b;
C: enum color={"red", "blue", "green"} a, b;
D: enum color {red, blue, green} a, b;
A: enum color {red, blue, grenn} a, b;
B: enum color={red, blue, green} a,b;
C: enum color={"red", "blue", "green"} a, b;
D: enum color {red, blue, green} a, b;
举一反三
- 以下定义枚举类型正确的是() A: enum<br/>color={red, yellow, blue}; B: enum<br/>color={“red”, “yellow”, “blue”}; C: enum<br/>color{“red”, “yellow”, “blue”} D: enum<br/>color{red=3, yellow, blue};
- 假设定义了:enum color {red=1, orange, yellow, green ,blue, purple, black};则blue的值是(
- 对于枚举类型的定义语句enum Color{Blue,Green=3,Black,White=6,Red};其中枚举常量Red的值为______。
- 下面span标签中HelloWorld字体的颜色是:()span{color:green;}.red{color:red;}#blue{color:blue;}HelloWorld A: green B: red C: blue D: black
- 阅读下面的程序, 请写出程序的输出结果 。 #include<iostream> using namespace std; int main () { enum Color {Red,Green,Blue}; Color color; color=Red; cout<<color<<","; color=Green; cout<<color<<","; color=Blue; cout<<color<<","; cout<<Red+Green+Blue<<endl; return 0; }