试题与答案

以下程序运行后的输出结果是______。 main() { int x,a=1,b=

题型:填空题

题目:

以下程序运行后的输出结果是______。 main() { int x,a=1,b=2,c=3,d=4; x=(a<b) a:b;x=(x<c) x:c;x=(d>x) x:d; pfintf("%d\n",x); }

答案:

参考答案:A

解析: 因为在条件表达式(a<b)a:b中,比较表达式a<b为真,所以x的值等于a的值等于1,后面两个条件表达式中的比较表达式都为真,所以最终x的值等于1。

试题推荐
题型:阅读理解

根据短文内容,判断正(T)、误(F)。

     Sports change with the season. People do not often play the same games in winter as in summer.

Sailing is fun in warm weather, but when it gets cold, it's time to change to other sports. People talk

about sports seasons. Baseball is only played for a few months of the year. This is called "baseball

season".

      Games and sports often grow out of the working people. In Portugal (葡萄牙) many people work

to catch fish. They fish from boats. Sometimes they use their boats for racing.

     Arabians (阿拉伯人) are famous for their horses. They use horses to travel over huge plains (平原).

Horseback riding is a very exciting sport in countries like Morocco (摩洛哥). When men ride horses at

greet speeds, they often stand up.

(     )1. People play the same games in winter as in summer.

(     )2. Games and sports are often created (创造) by the working people.

( )3. Arabians are famous for racing boats.

(     )4. People in Morocco like riding horses.

( )5. Sports change with the season.

查看答案
微信公众账号搜索答案