【单选题】【消耗次数:1】
以下能对一维数组a进行正确初始化的语句是( )。
int a[10]=(0,0,0,0)
int a[10]={}
int a[]={0};
int a[10]={10*1};
参考答案:
复制
纠错
相关题目
【单选题】 设有定义 int a[10]={0,0,0,0,0,0,0,0,0,0};则说法正确的是( )。
①  数组a有1个元素,其值为0
②  数组a有10个元素,各元素的值为0
③  数组a有10个元素,其中a[0]的值为0,其他元素的值不确定
④  数组初始化错误,初值个数少于数组元素个数
【单选题】 有说明语句int *p=new int[10];访问动态数组元素的正确语句是()
①  int a=p;
②  int a=*p;
③  delete int[]p
④  delete p int[10]
【单选题】 要定义一个int型数组A,并使其各元素具有初值9,0,3,0,0,不正确的定义语句是()
①  int A[]={9,0,3}
②  int A[]={9,0,3,0,0}
③  int A[5]={9,0,3}
④  int A[5]={9,0,3,0}
【单选题】 有说明语句int a[10];及函数int fun(int x[10],int n){return sizeof(x);},则语句cout<<fun(a,10)<<endl;的显示结果是()
①  40
②  10
③  4
④  0
【单选题】 已知int a[]={ 0,2,4,6,8,10 },*p=a+1;其值等于0的表达式是()
①  *(p++)
②  *(++p)
③  *(p--)
④  *(--p)
【单选题】 若有说明语句:int x[3][4];则以下关于x、*x、x[0]、&x[0][0]的正确描述是()。
①  x、*[x]、x[0]和x[0][0]均表示元素x[0][0]的地址
②  只有x、x[0]和x[0][0]表示的是元素x[0][0]的地址
③  只有x[0]和x[0][0]表示的是元素x[0][0]的地址
④  只有x[0][0]表示的是元素x[0][0]的地址
【单选题】 以下程序的输出结果是( ) main() { int x=-10,y= 1,z=1; if(xy) if(y0) z=0; else z=z+1; printf(“%d\n”,z); }
①  0
②  1
③  2
④  3
【单选题】 若有说明语句:int a[2][3]={0};,则下面正确的叙述是()。
①  此语句说明不正确
②  只有a[0][0]可以得到初值0
③  数组中的每个元素可以得到初值0
④  数组中的每个元素可以得到初值,但不一定为0
【单选题】 已知int a[10]={0,1,2,3,4,5,6,7,8,9},*p=a;不能表示数组a中元素的式子是()
①  *a
②  *p
③  a
④  a[p-a]
【单选题】 若有说明:int a[][4]={0,0};则下面不正确的叙述是( )。
①  数组a的每个元素都可以得到初值0
②  二维数组a的第一维大小为1
③  因为二维数组0中的第二维大小的值除以初值个数的商为1,故数组a行数为1
④  只有元素a[0][0]和a[0][1]可得到初值0,其余元素均得不到初值0.
随机题目
【单选题】 Anger is a normal emotion that we all feel from time to time. Some people express anger openly in a calm reasonable way. Some explode with anger, and scream and shout. But other people keep their anger inside. They can not or will not express it. This is called repressing anger. Many doctors think that repressing anger is more dangerous to a person’s health than expressing it. They say that when a person is angry, the brain gives out the same hormones (荷尔蒙) as that are produced during tense and nervous situations. They speed the heart rate and raise blood pressure, so the person feels excited and ready to act. Repressing these feelings will only make the feelings continue, and this can lead to many medical problems. To prevent these problems, these doctors suggest letting the anger out by expressing it freely. But recently some other doctors question this. They say that people who express anger repeatedly and violently become, in fact, more but not less angry. And this could cause medical problems. However, some doctors say that both repressing and expressing anger can be dangerous. They believe that those who express anger strongly may be more likely to develop heart diseases, and that those who keep their anger inside may face a greater danger of high blood pressure. Doctors say the solution is to learn how to deal with anger. The first step is to admit that you are angry and to recognize the real cause of the anger, and then to decide if the cause is serious enough to get angry about. If it is, do not express your anger while angry. Wait until your anger has cooled down, and express yourself calmly and reasonably. Doctors also say that a good way to deal with anger is to find humor in the situation that has made you angry, for laughter is much healthier than anger.What is the main idea of this passage?
①  Anger should be dealt with in a proper way.
②  Different people deal with anger in different ways.
③  Doctors suggest dealing with anger by repressing it.
④  The best way to deal with anger is to laugh when angry.
【单选题】 Trees mainly serve man in three important ways: They provide him with wood and other products; they provide him shade; and they help to prevent droughts and floods.Unfortunately, in many parts of the world, man has not realized that the third of these services is the most important.In his eagerness to make money from trees, he has cut them down in large numbers, only to find that without them he has lost the best friends he had. And besides, he is usually too careless to plant and look after new trees. So the forests slowly disappear.This does not only mean that man will have fewer trees. The results are even more serious: for where there are trees, their roots break up soil allowing the rain to sink in and also bind(固定) the soil, thus preventing it from being washed away easily;but where there are no trees, the rain falls on hard ground and flows away, causing floods and carrying away the rich top-soil. When the top-soil is gone, nothing remains but worthless desert.Two thousand years ago,a rich and powerful country cut down its trees to build warships, with which to gain itself an empire.It set up the empire, but, without its trees, its soil became poor and grew weak. When the empire fell to pieces, the home country found itself faced by floods and starvation(饥荒).Land becomes desert after all trees are cut down because __________.
①  roots of trees break up the soil
②  no tree keeps the rain and protects the top-soil
③  strong winds bring a lot of sand
④  there are too many rainfalls to make it
【单选题】 Trees mainly serve man in three important ways: They provide him with wood and other products; they provide him shade; and they help to prevent droughts and floods.Unfortunately, in many parts of the world, man has not realized that the third of these services is the most important.In his eagerness to make money from trees, he has cut them down in large numbers, only to find that without them he has lost the best friends he had. And besides, he is usually too careless to plant and look after new trees. So the forests slowly disappear.This does not only mean that man will have fewer trees. The results are even more serious: for where there are trees, their roots break up soil allowing the rain to sink in and also bind(固定) the soil, thus preventing it from being washed away easily;but where there are no trees, the rain falls on hard ground and flows away, causing floods and carrying away the rich top-soil. When the top-soil is gone, nothing remains but worthless desert.Two thousand years ago,a rich and powerful country cut down its trees to build warships, with which to gain itself an empire.It set up the empire, but, without its trees, its soil became poor and grew weak. When the empire fell to pieces, the home country found itself faced by floods and starvation(饥荒).In many places forests slowly disappear because __________.
①  many trees have been cut down by man
②  new trees are not well looked after
③  man has not paid enough attention to planting trees
④  all the above
【单选题】 Trees mainly serve man in three important ways: They provide him with wood and other products; they provide him shade; and they help to prevent droughts and floods.Unfortunately, in many parts of the world, man has not realized that the third of these services is the most important.In his eagerness to make money from trees, he has cut them down in large numbers, only to find that without them he has lost the best friends he had. And besides, he is usually too careless to plant and look after new trees. So the forests slowly disappear.This does not only mean that man will have fewer trees. The results are even more serious: for where there are trees, their roots break up soil allowing the rain to sink in and also bind(固定) the soil, thus preventing it from being washed away easily;but where there are no trees, the rain falls on hard ground and flows away, causing floods and carrying away the rich top-soil. When the top-soil is gone, nothing remains but worthless desert.Two thousand years ago,a rich and powerful country cut down its trees to build warships, with which to gain itself an empire.It set up the empire, but, without its trees, its soil became poor and grew weak. When the empire fell to pieces, the home country found itself faced by floods and starvation(饥荒).According to the passage, which is the most important service of trees to man?
①  They help him make money.
②  They give him cool.
③  They give him wood and other things.
④  They help him to stop droughts and floods.
【单选题】 Trees mainly serve man in three important ways: They provide him with wood and other products; they provide him shade; and they help to prevent droughts and floods.Unfortunately, in many parts of the world, man has not realized that the third of these services is the most important.In his eagerness to make money from trees, he has cut them down in large numbers, only to find that without them he has lost the best friends he had. And besides, he is usually too careless to plant and look after new trees. So the forests slowly disappear.This does not only mean that man will have fewer trees. The results are even more serious: for where there are trees, their roots break up soil allowing the rain to sink in and also bind(固定) the soil, thus preventing it from being washed away easily;but where there are no trees, the rain falls on hard ground and flows away, causing floods and carrying away the rich top-soil. When the top-soil is gone, nothing remains but worthless desert.Two thousand years ago,a rich and powerful country cut down its trees to build warships, with which to gain itself an empire.It set up the empire, but, without its trees, its soil became poor and grew weak. When the empire fell to pieces, the home country found itself faced by floods and starvation(饥荒).Which title best fits the passage?
①  Trees and Man
②  The Function of Tree Wood
③  How do People do with Trees?
④  The Usage of Tree Roots
【单选题】 Trees mainly serve man in three important ways: They provide him with wood and other products; they provide him shade; and they help to prevent droughts and floods.Unfortunately, in many parts of the world, man has not realized that the third of these services is the most important.In his eagerness to make money from trees, he has cut them down in large numbers, only to find that without them he has lost the best friends he had. And besides, he is usually too careless to plant and look after new trees. So the forests slowly disappear.This does not only mean that man will have fewer trees. The results are even more serious: for where there are trees, their roots break up soil allowing the rain to sink in and also bind(固定) the soil, thus preventing it from being washed away easily;but where there are no trees, the rain falls on hard ground and flows away, causing floods and carrying away the rich top-soil. When the top-soil is gone, nothing remains but worthless desert.Two thousand years ago,a rich and powerful country cut down its trees to build warships, with which to gain itself an empire.It set up the empire, but, without its trees, its soil became poor and grew weak. When the empire fell to pieces, the home country found itself faced by floods and starvation(饥荒).Why did the country mentioned in the passage suffer from floods and starvations?
①  Because it set up an empire.
②  Because it fell to pieces.
③  Because it turned its trees into warships.
④  Because it spent too much money on wars.
【单选题】 Goats are being hired to do the work of people near San Diego. The fires that occurred in Hillborbough four years ago destroyed thirty homes, most of which have been rebuilt. While people were rebuilding the homes, the grasses and bushes were growing back. The area is now so overgrown in bushes that there is again a major danger of fire.The city government put up bids to remove the bushes. The lowest bid they received was $50,000—and that was if the city provided breakfast and lunch for the workers for the six weeks it would take to clear the overgrown area. The city only wanted to give unlimited coffee and a piece of bread a day for each person. When that offer was rejected, the city asked for help on its website.A sheepherder in Montanta and a goat-keeper in San Bernardino read about the city’s plight(困境)while surfing the Web. They both offered to do the job for $25,000. The city government chose the goat-keeper because he lived closer. When he was told that the city dump(垃圾场)was overflowing , the goat-keeper said, “No problem. My goats will eat everything in your dump, except the car engines, of course.” So, for another $5,000, the city killed two birds with one stone. If all goes well, they will invite the goat-keeper and his “family” back every three years. The goat-keeper said that he would probably visit San Diego while his goats were in the dump. The city government faces a serious problem because __________.
①  fires destroyed thirty homes in a neighborhood four years ago
②  the speed of rebuilding the houses is really too slow
③  the overgrowing plants in this area have made the city look terrible
④  the overgrowing plants in this area have become a big danger of fire
【单选题】 Goats are being hired to do the work of people near San Diego. The fires that occurred in Hillborbough four years ago destroyed thirty homes, most of which have been rebuilt. While people were rebuilding the homes, the grasses and bushes were growing back. The area is now so overgrown in bushes that there is again a major danger of fire.The city government put up bids to remove the bushes. The lowest bid they received was $50,000—and that was if the city provided breakfast and lunch for the workers for the six weeks it would take to clear the overgrown area. The city only wanted to give unlimited coffee and a piece of bread a day for each person. When that offer was rejected, the city asked for help on its website.A sheepherder in Montanta and a goat-keeper in San Bernardino read about the city’s plight(困境)while surfing the Web. They both offered to do the job for $25,000. The city government chose the goat-keeper because he lived closer. When he was told that the city dump(垃圾场)was overflowing , the goat-keeper said, “No problem. My goats will eat everything in your dump, except the car engines, of course.” So, for another $5,000, the city killed two birds with one stone. If all goes well, they will invite the goat-keeper and his “family” back every three years. The goat-keeper said that he would probably visit San Diego while his goats were in the dump. Why was the goat-keeper chosen to remove the bushes?
①  Because he offered to do it for the lower price.
②  Because it was easier to transport his goats.
③  Because his goats can do the job better.
④  Because the city wanted to raise more goats.
【单选题】 Goats are being hired to do the work of people near San Diego. The fires that occurred in Hillborbough four years ago destroyed thirty homes, most of which have been rebuilt. While people were rebuilding the homes, the grasses and bushes were growing back. The area is now so overgrown in bushes that there is again a major danger of fire.The city government put up bids to remove the bushes. The lowest bid they received was $50,000—and that was if the city provided breakfast and lunch for the workers for the six weeks it would take to clear the overgrown area. The city only wanted to give unlimited coffee and a piece of bread a day for each person. When that offer was rejected, the city asked for help on its website.A sheepherder in Montanta and a goat-keeper in San Bernardino read about the city’s plight(困境)while surfing the Web. They both offered to do the job for $25,000. The city government chose the goat-keeper because he lived closer. When he was told that the city dump(垃圾场)was overflowing , the goat-keeper said, “No problem. My goats will eat everything in your dump, except the car engines, of course.” So, for another $5,000, the city killed two birds with one stone. If all goes well, they will invite the goat-keeper and his “family” back every three years. The goat-keeper said that he would probably visit San Diego while his goats were in the dump. What are the “two birds” that the city government kills with only one stone?
①  Both the sheepherder and goat-keeper will work for the city for $25,000.
②  The danger of fire and providing breakfast and lunch for the work crews.
③  The danger of fire and the overflowing dump.
④  The city government can save some money and the goat-keeper has a new job.
【单选题】 Goats are being hired to do the work of people near San Diego. The fires that occurred in Hillborbough four years ago destroyed thirty homes, most of which have been rebuilt. While people were rebuilding the homes, the grasses and bushes were growing back. The area is now so overgrown in bushes that there is again a major danger of fire.The city government put up bids to remove the bushes. The lowest bid they received was $50,000—and that was if the city provided breakfast and lunch for the workers for the six weeks it would take to clear the overgrown area. The city only wanted to give unlimited coffee and a piece of bread a day for each person. When that offer was rejected, the city asked for help on its website.A sheepherder in Montanta and a goat-keeper in San Bernardino read about the city’s plight(困境)while surfing the Web. They both offered to do the job for $25,000. The city government chose the goat-keeper because he lived closer. When he was told that the city dump(垃圾场)was overflowing , the goat-keeper said, “No problem. My goats will eat everything in your dump, except the car engines, of course.” So, for another $5,000, the city killed two birds with one stone. If all goes well, they will invite the goat-keeper and his “family” back every three years. The goat-keeper said that he would probably visit San Diego while his goats were in the dump. According to the passage, __________.
①  the sheepherder offered to do the job for $50,000
②  the lowest bid to remove the bushes was $50,000
③  the sheepherder and the goat-keeper were both addicted to surfing the Internet
④  hiring goats to do the job saved the city government lots of money