2 dabentudou dabentudou 于 2016.01.15 00:19 提问

设有定义“enum term { my, your=4, his, her=his+10};”

设有定义“enum term { my, your=4, his, her=his+10};”,则printf(“%d,%d,%d,%d\n”,my, your, his, her);的输出是( )

①0,l,2,3 ②0,4,0,10

③0,4,5,15 ④1,4,5,15

3个回答

caozhy
caozhy   Ds   Rxr 2016.01.15 00:35
已采纳

选③0,4,5,15

91program
91program   Ds   Rxr 2016.01.15 08:43

enum 默认是从零开始的,如果没有赋值就依次加1;
但如果有赋值,就以赋值为准。下一个枚举变量为前一个枚举变量加1.

所以,答案是:3

CSDNXIAOC
CSDNXIAOC   2016.01.15 00:20

How many persons a human being loved in his or her whole life? who can count ? -It depends on every individual... right? -How many people will miss you when youre gone, how many people will be there ......
答案就在这里:How many persons a human being love in his or her whole life
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
辞职信(英文)
RESIGNATION LETTER (邮件标题)Dear Mr. XXX:Im sorry to offer you my resignation, Ive decided to leave this company for personal reasons. My lastday will be March 22, 2009. Theres one month prior to my d
[美剧赏析] 权力的游戏<Game of Thrones>完全赏析 (11-12)
最近阿伟看多了五毛动画,突然想看看那些成熟的动画是怎样的,于是决定看几部美剧。 GoT是阿伟选择的第一站,由于这部作品的亮点非常的多,所以会进行全面的解析,这已 经不单纯是剧透的级别了。所以如果诸位朋友没有完整的看过这部片,先去看一看吧。 Well struck. Well struck, Dog. Did you like that? It was well s
CRB and His Birthday(HDUOJ--5410
Problem Description Today is CRB's birthday. His mom decided to buy many presents for her lovely son. She went to the nearest shop with M Won(currency unit). At the shop, there are N kinds
This is Your usual TIC-TAC-TOE game. In this one the player
This is Your usual TIC-TAC-TOE game. In this one the player that has won has to click on his/her textbox to increment the score.
HDU 5410 CRB and His Birthday(完全背包)——多校练习10
HDU 5410 CRB and His Birthday(完全背包)——多校练习10
HDU 5236 Article [概率DP]
As the term is going to end, DRD begins to write his final article. 你现在要打n个字符,但是程序随时可能会崩溃。你可以在恰当的时机按下 Ctrl−S键,崩溃后,会从最后一次保存的情况继续开始打字。
POJ 1925 Spiderman (DP)
Description Dr. Octopus kidnapped Spiderman’s girlfriend M.J. and kept her in the West Tower. Now the hero, Spiderman, has to reach the tower as soon as he can to rescue her, using his own weapon, th
已知有枚举类型定义:enum MyEn{a=101,b,c=207,d,e,f,g},编程输出第5个枚举元素的序号值
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _2._3._2 {     enum MyEn { a = 101, b, c = 207, d, e, f, g };       class Program     {    
hdoj 5410 CRB and His Birthday 【0-1背包 + 完全背包】
CRB and His Birthday Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1083    Accepted Submission(s): 545 Problem Description Today
leetcode274. H-Index
Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher’s h-index.According to the definition of h-index on Wikipedia: “A scien