问题 单项选择题

有以下程序 #include<iostream> using namespace std; static int days []={31,28,31,30,31,30,3l,31,30,31,30,31}; class date { private:int month,day,year; public:date(int m,int d,int y) {month=m;day=d;year=y; } date() {} void disp() { cout<<year<<"-"<<month<<"-"<<day<<end1; } date operator+(int day) {date dt=*this;day+=dt.day; while(day>days[dt.month-1]) {day-=days[dt.month-1];if(++dt.month==13) {dt.month=1;dt.year++;} }dt.day=day;retrn dt; } }; int main() { date d1(6,20,2004),d2; d2=d1+20; d2.disp(); return 0; } 执行后的输出结果是

A.2004-7-10

B.2004-6-20

C.2004-7-20

D.程序编译时出错

答案

参考答案:A

解析: 本题考核运算符的重载。本题通过将“+”运算符重载为类date的成员函数实现简单的对象加法,

阅读理解

阅读理解

Dear Wang Jun,

     Thank you very much for your letter and the photos of Beijing. Beijing looks very beautiful! I'm fine. I have a good

time. And I'm very busy with my lessons. I have six classes every day, four in the morning and two in the afternoon. I

like English very much. I'm learning Chinese. Chinese is very difficult. I do my best to learn it, but I'm not very good. I

like P.E. best because it's very interesting. I can play football and basketball. By the way, do you like English? Can you

speak English well? What do you think of America? Welcome to New York(纽约). I hope you can come to New York

one day.

                                                                                                                                                                Love,

                                                                                                                                                                Frank

1. Who writes this letter? __________

A. Love

B. Scott

C. Wang Jun

D. Frank

2. The letter comes from __________.

A. China

B. Beijing

C. America

D. Canada

3. The writer(作者) likes __________ best.

A. P.E.

B. basketball

C. English

D. football

4. The writer thinks Chinese is __________.

A. fun

B. difficult

C. interesting

D. boring

5. The letter is mainly(主要地) about __________.

A. the writer's work in China

B. the writer's friend Wang Jun

C. the writer's school life

D. Beijing's love

单项选择题