问题 单项选择题

若有下列定义(设int类型变量占2个字节):

float x=123.4567;

则下列语句:

printf("x=%5.2f",x);

输出的结果是( )。

A.x=123.46

B.123.4567

C.x=123.4567

D.123.46

答案

参考答案:A

解析: 本题考查printf函数的格式。“%5.2f”格式符中的“f”表示以带小数点的形式输出单精度或者双精度数;“5”表示指定数据输出宽度为5;“.2”表示指定输出数据小数位占2位数,并对截去的第一位小数做四舍五入处理。

选择题
阅读理解

小题1:Faced with declining enrollments and declining revenues, many public schools in the US are _____________________ get students from abroad, particularly from China.

小题2:Going to study in the US high school will _____________________ some Chinese students because it can increase their chances of entering an American university.

小题3:During a typical Romanian wedding ceremony, the newly-weds _____________________ usually _____________________ love and care from their relatives and neighbors.

小题4:Fifty years ago on April 12, the Russian astronaut Yuri Gagarin _____________________ worldwide as he became the first man in space, propelled into orbit on a Russian made rocket.

小题5:The US is a country which _____________________ people of different colors, races and religions, but sometimes the diversity can lead to problems.

小题6:Some people have to take special precautions when they go out in spring _____________________ suffering from seasonal allergy such as sneezing, watery eyes and runny noses.

小题7:Baseball _____________________ in the US because it’s not simply a game, but has become woven into the fabric of American culture.

小题8:The 32-year-old Taiwanese star Show Luo is at the peak of his singing career now, but his career hit a low _____________________ when he lost all his hosting jobs and got cold looks from people.

小题9:The latest Apple iPad 2 was _____________________ by the Apple Company at the end of March in 25 countries and it caused massive line-ups at stores across the U.S.

小题10:Several Libyan diplomats resigned their posts and _____________________ Gaddafi, describing him as a “dictator” and calling on him to step aside to avoid further bloodshed.