问题 填空题

以下程序运行后的输出结果是 【16】 。 fun(int a) { int b=0;static int c=3; b++;c++; return(a+b+c) ; } main() { int i,a=5; for(i=0;i<3;i++)printf("%d%d",i,fun(a) ); prind("\n"); }

答案

参考答案:010111212

解析:需要注意的是,函数fun()中的变量c为静态局部变量,在静态存储区内分配了存储单元,在程序整个运行期间不会释放,所以调用函数时,只赋初值一次,以后再调用函数时,c中的值为上次调用函数时的值。执行for循环,当i=0时,fun(5)=5+1+4= 10,此时c=4;当i=1时,fun(5)=5+1+5=11,此时c=5;当i=2时,fun(5)=5+1+6 =12;此时c=6:当i=3时,退出for循环,并输出回车换行符。

完形填空
I was a student of yours in Grade Six, and I hope you still remember me. I’m __   this letter because I want to let you know that the school year with you was important and special to me.
I know I __   be very quiet in your class, and you never said much to me. But you did something that made a big _____ in my life. You see, all through my first year in schools, I hated to read. Books were just words that had ____ to do with me, and I felt bored while reading them. I’ll never ____ the first day of Grade Six when you took out a thick book and began to read the story to our class. It ____ that your voice changed with the people in the story, and you drew pictures in my mind as you read ____  . Since that day, I always waited for the time that you read to the class. You ___ us all kinds of wonderful stories.
During the summer after my year in your class, I ____ the stories you read. So one day I picked up a book and read it all by myself. I found out that I could make the words ____    , too. Now, I love to read! Thank you for opening the world of books for me.
Yours,
Linda
小题1:
A.watchingB.reading C.writingD.getting
小题2:
A.usedB.used toC.was usedD.was used to
小题3:
A.differenceB.mistakeC.decisionD.progress
小题4:
A.nothingB.everythingC.something D.anything
小题5:
A.rememberB.knowC.forgetD.understand
小题6:
A.likedB.lookedC.looked likeD.seemed
小题7:
A.loudlyB.quietC.aloudD.quietly
小题8:
A.toldB.readC.borrowedD.taught
小题9:
A.finishedB.practicedC.missedD.kept
小题10:
A.boringB.patientC.interestingD.necessary
问答题