问题 问答题

基本操作题下面的程序是求9999以内的"完全数"。所谓完全数是指这样的自然数:它的各个约数(不包括该数自身)之和等于该数自身。如28=1+2+4+7+14就是一个完全数。请在程序的每条横线处填写一个语句,使程序的功能完整。注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。public class QuanShu{ public static void main(String args[]){ for(int n=1;n<9999;n++) if( )System.out.println(n);}public static int divsum(int n){//该方法功能是求一个数的所有约数 int s=0; for(int i=1;i

答案

参考答案:n==divsum(n) n%i==0 s+=i;

解析:本题考查for循环语句、求余运算符(%)和Java语言的方法的使用。解答本题的关键是熟悉使用for循环语句。在本题中,if(n==divsum(n))语句是用来调用divsum(n)方法(其中n为方法的实际参数)和判断某个自然数是否为"完全数"。n%i==0 是用来判断数n是否能被数i整除, s+=i;是用来累加某个自然数的所有约数。

阅读理解

What is your favourite English letter? Many of you may say Q. Why?Because so many of you chat with your friends on QQ. What do you like about QQ? What do you talk about? The CCTV reporter, Miss Wang, interviews three kids. Let’s listen to what they say.

When do you chat on QQ? What do you talk about?

Lin Yuhan, Xi’an: On weekends. We talk about homework and chat with each other.

Tang Xuting, Shanghai: At weekends and when I don't have much homework. We exchange test answers and chat.

Yang Yuhang, Dalian: Our class goes online together at 4——6 pm on weekends. We complain about homework, chat and talk about computer games.

What do you put on your QQ blog(博客)?

Lin: I put good articles I have found online on my blog. I also write articlesmyself. They are about funny things that have happened in my class.

Tang: I put pictures on my blog. Not my own photos, but pictures from myfavorite Japanese cartoons like Tennis Prince and Conan.

Yang: I put DV films on my blog. I shoot(拍摄) them during sports meetingsand school parties. The most popular one is about a dancing teacher. Itis so funny that everyone watches it.

How do you like QQ?

Lin: It’s a good place for us to make a record of our lives, of both good timesand sad times.

Tang: My friends and I may not have time to chat at school. But we can doit on QQ. It’s very helpful to our friendships.

Yang: If you chat with friends on the telephone, your parents sometimeslisten in on your conversation. There’s no such problem with QQ. Youcan relax and talk freely.

小题1:How many kids are interviewed about QQ?

A.Nine.

B.Six.

C.Three.

D.Two.小题2:comes from Shanghai.

A.Miss Wang

B.Lin Yuhan

C.Yang Yuhang

D.Tang Xuting小题3:What does Yang Yuhang talk about on QQ on weekends?

① homework  ② chat   ③ test answers   ④ computer games

A.①②

B.②③

C.①②④

D.②③④小题4:What does Lin Yuhan put on her QQ blog?

A.Some pictures.

B.Good articles.

C.DV films.

D.Japanese cartoons.小题5:Which one is TRUE according to this article?

A.Lin says QQ is very helpful to their friendships.

B.Yang says he can chat freely with many friends and relax on QQ.

C.Tang says QQ is a good space for them to make a record of their lives.

D.Tang says he chats on QQ on weekdays though he has lots of homework.

判断题