15、若定义enum color{red,yellow,green=5,blue,white}aa;则执行以下语句后aa
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/07 10:12:56
15、若定义enum color{red,yellow,green=5,blue,white}aa;则执行以下语句后aa的值为-—C—————.
aa=white;
printf(”%d”,aa);
(A)white (B)4 (C)7 (D)5
为什么,还有enum
aa=white;
printf(”%d”,aa);
(A)white (B)4 (C)7 (D)5
为什么,还有enum
enum color { red,yellow,green = 5,blue,white }
以C#中,上面的语句是定义枚举类型,是值类型.
枚举类型可转成int型,但需要显示转换,枚举型转成int型时,默认从0开始,但可通过自定义来改变其顺序.
Console.WriteLine((int)color.red); //输出0
Console.WriteLine((int)color.yellow); //输出1
Console.WriteLine((int)color.green ); //输出5
Console.WriteLine((int)color.blue); //输出6
Console.WriteLine((int)color.white); //输出7
看你使用的printf("%d",aa);以vc++语法,应该也是这样的.
以C#中,上面的语句是定义枚举类型,是值类型.
枚举类型可转成int型,但需要显示转换,枚举型转成int型时,默认从0开始,但可通过自定义来改变其顺序.
Console.WriteLine((int)color.red); //输出0
Console.WriteLine((int)color.yellow); //输出1
Console.WriteLine((int)color.green ); //输出5
Console.WriteLine((int)color.blue); //输出6
Console.WriteLine((int)color.white); //输出7
看你使用的printf("%d",aa);以vc++语法,应该也是这样的.
15、若定义enum color{red,yellow,green=5,blue,white}aa;则执行以下语句后aa
color,red,yellow,green,blue,black,white,purple,brown,name,te
c语言问题(枚举法)#includevoid main(){enum color {red,yellow,white,b
Res+yellow=?Red+white=?Red+blue+yellow=?
英语加法red+yellow= yellow+blue= red+blue= black+white=white+red
求解下列程序段中,枚举变量c1,c2的值依次是().enum color {red,yellow,blue=4,gree
blue+red=?blue+yellow=?red+yellow=?white+black=?
四个关于颜色的单词?(除了"red、black、white、yellow、blue、green、orange、brown
oranye pinrk yellow green blue red brown gray white black造句`
带颜色的英语俚语填空red,black,blue,white,yellow,green,purple,golden.wh
Red+blue+Yellow=
blue+red+yellow=