若有定义:inta[]={1,2,3,4,5,6,7,8,9,10};,则值为5的表达式是()
由题可知a[4]的值为5而a[3]的值为4, 所以可以将4用a[3]替换,所以 a[a[3]]的值为5
定义了二维数组inta[3][3]={{1,2},{3,4},{5,6,7}};则数组元素a[2][2]的值是()
数组a的9个值分别为第0行:1 2 0第1行:3 4 0第2行:5 6 7
以下程序的输出结果是()intmain(){inta[3][3]={1,2,3,4,5,6,7,8,9};intsum=0,i,j;for(i=0;i<3;i++)for(j=0;j<3;j++)if(i==j)sum=sum+a[i][j];printf(“sum=%d”,sum);}
数组相当于存储了如下的矩阵:1 2 34 5 67 8 9程序的功能是求主对角线上3个元素的和,即1+5+9=15
以下程序输出结果是()。#include<stdio.h>structabc{inta,b,c;};main(){structabcs[2]={{1,2,3},{4,5,6}};intt;t=s[0].a+s[1].b;printf("%d\n",t);}
s[0].a=1,s[1].b=5
#include<stdio.h>voidtest(inta[],inti){a[i]=9;}voidmain(){inti=5;intarray[]={0,1,2,3,4,5,6};test(array,i);printf("%d\n",array[i]);}运行结果是( )
通过将数组名作为实参传递给自定义函数,可以实现在自定义函数中修改数组中数组元素的值。在test函数中修改了a[i]的值,修改后为9。
#include<stdio.h>voidtest(inta[],inti){a[i]=9;}voidmain(){inti=5;intarray[]={0,1,2,3,4,5,6};test(array,i);printf("%d\n",array[i]);}运行结果是( )
通过将数组名作为实参传递给自定义函数,可以实现在自定义函数中修改数组中数组元素的值。在test函数中修改了a[i]的值,修改后为9。
PartIIReadingComprehensionDirections:Thereareseveralpassagesinthissection.Eachpassageisfollowedbysomequestionsorunfinishedstatements.ForeachofthemtherearefourchoicesmarkedA),B),C)andD).Youshoulddecideonthebestchoice.PassageOneQuestions2to6arebasedonthefollowingpassage.“Chinaisexpectedtocompleteitsfirstexploration(探索)ofthemoonin2010andwillfoundamoonbasejustaswedidontheNorthandSouthPoles,”OuyangZiyuan,headofChina’smoonexplorationprogram,promisedduringnationalscienceandtechnologyweek.Afteritsfirstmaninspace,Chinaplansaspacelaboratory,alunarorbitertolookforvaluableelementsandminerals,robotlandingsonthemoonandthenthehumantouchdown.Thepriceofspaceexplorationisenormous.RussiaandtheUS,theonlytwocountriestohaveachievedmannedflight,arestrugglingtokeeptheirnewinvestment,theinternationalspacestation.ButChina,whichhasalongtraditioninphysics,mathematicsandengineering,findsitsdoctoralgraduateswelcomedintheUSandEuropefordecades.Andithasbeenabletolearnfrom40yearsofpioneeringsuccessesandmistakesbytheUSSRandtheUSA.Spaceflightisagambleandthestakes(赌注)arehigh.Ifsuccessful,Chinacouldbecomeamemberoftheworld’smostexclusiveclub,setupasecondhomeonthemoonandgetapowerfulhandatthestrategicbargainingtable.TwodesignersfromtheShenzhouIIIprojectsaidthat12astronautsnowareundergoingintensivetraining.Onemoreunmannedspaceflightisplannedbeforethefirstmannedlaunch.ExpertssaythattheShenzhouspacecraftalreadyprovidesChinawithaspacevehiclecapableofmounting(发起)alunarprogram.ChinesescientistshavealsopredictedthatMarswillbethenexttargetafterthemoon.2.AccordingtoOuyangZiyuan,________.
PartIIReadingComprehensionDirections:Thereareseveralpassagesinthissection.Eachpassageisfollowedbysomequestionsorunfinishedstatements.ForeachofthemtherearefourchoicesmarkedA),B),C)andD).Youshoulddecideonthebestchoice.PassageOneQuestions2to6arebasedonthefollowingpassage.“Chinaisexpectedtocompleteitsfirstexploration(探索)ofthemoonin2010andwillfoundamoonbasejustaswedidontheNorthandSouthPoles,”OuyangZiyuan,headofChina’smoonexplorationprogram,promisedduringnationalscienceandtechnologyweek.Afteritsfirstmaninspace,Chinaplansaspacelaboratory,alunarorbitertolookforvaluableelementsandminerals,robotlandingsonthemoonandthenthehumantouchdown.Thepriceofspaceexplorationisenormous.RussiaandtheUS,theonlytwocountriestohaveachievedmannedflight,arestrugglingtokeeptheirnewinvestment,theinternationalspacestation.ButChina,whichhasalongtraditioninphysics,mathematicsandengineering,findsitsdoctoralgraduateswelcomedintheUSandEuropefordecades.Andithasbeenabletolearnfrom40yearsofpioneeringsuccessesandmistakesbytheUSSRandtheUSA.Spaceflightisagambleandthestakes(赌注)arehigh.Ifsuccessful,Chinacouldbecomeamemberoftheworld’smostexclusiveclub,setupasecondhomeonthemoonandgetapowerfulhandatthestrategicbargainingtable.TwodesignersfromtheShenzhouIIIprojectsaidthat12astronautsnowareundergoingintensivetraining.Onemoreunmannedspaceflightisplannedbeforethefirstmannedlaunch.ExpertssaythattheShenzhouspacecraftalreadyprovidesChinawithaspacevehiclecapableofmounting(发起)alunarprogram.ChinesescientistshavealsopredictedthatMarswillbethenexttargetafterthemoon.2.AccordingtoOuyangZiyuan,________.
孙子兵法的作者是孙武。