问题 单项选择题

设以下变量均为int类型,则值不等于7的表达式是( )。

A. (x=y=6,x+y,X+1)

B. (x=y=6,x+y,y+1)

C. (x=6,x+1,y=6,x+y)

D. (y=6,y+1,x+y,x+1)

答案

参考答案:C

解析:C++语言中逗号“,”也是一种运算符,称为逗号运算符。其功能是把两个表达式连接起来组成一个表达式,称为逗号表达式。其一般形式为:表达式1,表达式2,其求值过程是分别求两个表达式的值,并以表达式2的值作为整个逗号表达式的值。逗号表达式的一般形式可以扩展为:表达式1,表达式2,表达式3,…,表达式n,它的值为表达式n的值。

单项选择题

A tree’s age can be determined by counting the annual growth rings in its trunk. Each ring represents one year, and the ring’s thickness reveals the relative amount of rainfall that year. Archaeologists successfully used annual rings to determine the relative ages of ancient tombs at Pazyryk. Each tomb was constructed from freshly cut logs, and the tombs’ builders were constrained by tradition to use only logs from trees growing in the sacred Pazyryk Valley.
Which one of the following, if true, contributes most to an explanation of the archaeologists’ success in using annual rings to establish the relative ages of the tombs at the Pazyryk site ?()

A.The Pazyryk tombs were all robbed during ancient times, but breakage of the tombs’ seals allowed the seepage of water, which soon froze permanently, thereby preserving the tombs’ remaining artifacts.

B.The Pazyryk Valley, surrounded by extremely high mountains, has a distinctive yearly pattern of rainfall, and so trees growing in the Pazyryk Valley have annual rings that are quite distinct from trees growing in nearby valleys.

C.Each log in the Pazyryk tombs has among its rings a distinctive sequence of twelve annual rings representing six drought years followed by three rainy years and three more drought years.

D.The archaeologists determined that the youngest tree used in any of the tombs was 90 years old and that the oldest tree was 450 years old.

E.All of the Pazyryk tombs contained cultural artifacts that can be dated to roughly 2300 years ago.

单项选择题