试题与答案

下面程序的输出结果为 【7】 。 #include<iostream> usin

题型:填空题

题目:

下面程序的输出结果为 【7】
#include<iostream>
using namespace std;
void initialize (int print No,int state=0);
void initialize(int printNo=1,int state);
int main()

initialize();
retum 0;

void initialize (int printNo,int state)

cout<<printNo<<","<<state<<end1;

答案:

参考答案:1,0

解析: 本题考核带有缺省值的函数,本题中函数initialize()进行了两次函数原型的说明,使本来不带默认值的形参带上默认值。由于主函数中调用initialize()时没有给定实参,所以函数自动调用其参数缺省值。输出1和0。

试题推荐
题型:阅读理解

阅读理解

     In the summer of 1978 an English farmer was driving his tractor through a field of wheat when he

discovered that some of his wheat was lying flat on the ground. The flattened wheat formed a circle about

six meters across. Around this circle were four smaller circles of flattened wheat. The five circles were in a formation like five dots (点) . During the following years , farmers in England found the strange circles in

their fields more and more often.

     The circles are called "crop circles" because they appear in the fields of grain-usually wheat or com.

The grain in the circles lies flat on the ground but is never broken;it continues to grow, and farmers can

later harvest it. Farmers always discover the crop circles in the morning, so the circles probably form at

night. They appear only in the months from May to September.

      At first, people thought that the circles were a hoax.Probably young people were making them as a

Joke or farmers were making them to attract tourists. To prove that the circles were a hoax , people tried

to make circles exactly like the ones that farmers had found. They couldn' t do it. They couldn ' t enter a

field of grain without leaving tracks, and they couldn ' t flatten the grain without breaking it.

     Many people believe that beings from outer space are making the circles to communicate(交流) with us and that the crop circles are messages from them.

     Scientists who have studied the crop circles suggested several possibilities. Some scientists say that a

downward rush of wind leads to the formation of the circles-the same downward rush of air that

sometimes causes an airplane to crash. Other scientists say that forces within the earth cause the circles to appear. There is one problem with all these scientific explanations; crop circles often appear in groups ,

like the five-dot formation. It is hard to believe that any natural force could form those.

1. In the summer of 1978 , an English farmer discovered in his field that________.  

A. some of his wheat had been damaged

B. his grain was growing up in circles

C. his grain was moved into several circles

D. some of his wheat had fallen onto the ground

2. According to the text, the underlined part "a hoax" in paragraph 3 probably means ___________.   

A. an attempt made to fool people

B. a special way to plant crops

C. a research on the force of winds

D. an experiment for the protection of crops

3. Which of the following may prove that the crop circles were not made by man? 

A. The farmers couldn't step out of the field.

B. The farmers couldn't make the circles round.

C. The farmers couldn't leave without footprints.

D. The farmers couldn't keep the wheat straight up.

4. That the crop circles are made by_______is probably true. 

A. air movement

B. airplane crashes

C. new farming techniques

D. unknown flying objects

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