问题 单项选择题

以下程序的输出结果是______。
main()
int num=0
while(num<=2)
num++; printf("%d\n",num);

A)
1
2
3
4
B)
1
2
3
C)
1
2
D)
1

答案

参考答案:B

解析: while的执行过程是:先计算条件表达式的值,若成立则执行循环体,重复上述过程,直到条件表达式的值为“假” (值为零)时,退出循环,并转下一语句去执行。本题在输出num的值为3之后,再判断while的循环条件3<=2,不成立,所以不再输出num的值,故本题的答案选B。

问答题 简答题
单项选择题

Are you dreaming of taking a trip on your own Here is some advice on how to make your once-in-a-lifetime journey and how to stay safe when you get there.

Before you begin to look at places, activities and plane tickets, you must set a budget. When you search through the websites about travelling, it can be so easy to add another week here or there, or choose an extra activity. Setting a budget can avoid creating a huge bill, which starts very small.

With so many countries on this planet it is difficult to decide where to go. By narrowing down your search to voluntary work or a relaxing holiday, you can save a lot of time looking through websites.

After deciding where to go, you need to research the country. Find out when each season is. It would be disappointing if you were taking part in an outdoor-based activity and it rained most days. Look into medical information, as you may need certain medicine for certain countries. Above all, make sure you can afford to go to this country and take part in the activities you have dreamt about. Don’t raise your hopes too high before you know for certain it is within your budget.

By carrying a credit (信用) card with you at all times it is possible to stop yourself getting lost. Mobile phones are very important as well. However, do not depend completely on them, since electronic machines can break without warning. Therefore, always carry a list of emergency (紧急情况) phone numbers, names and addresses. Finally, learn a little of the language. Do not expect that the people there speak your own language. After all, you are in their country.

What does the word "budget" in Paragraph 2 mean().

A.记录

B.生意

C.预算

D.决定