问题 单项选择题

有如下嵌套的if语句:
if(a<b)
if(a<c)k=a;
else k=c:
else
if(b<c)k=b;
else k=c;
以下选项中与上述if语句等价的语句是( )。

A.k=(a<b)a:b;k=(b<c)b:c;
B.k=(a<b)((b<c)a:b):((b>c)b:c);
C.k=(a<b)((a<c)a:c):((b<c)b:c);
D.k=(a<b)a:b;k=(a<c)a:c;

答案

参考答案:C

解析: 条件运算符(:)是C语言中唯一的一个三目运算符,它是对第一个表达式做真/假检测,然后根据结果返回另外两个表达式中的一个。<表达式1><表达武2>:<表达式3>。在运算中,首先对第一个表达式进行检验,如果为真,则返回表达式2的值:如果为假,则返回表达式3的值。

完形填空
任务型阅读(共10小题;每小题1分,满分10分)
请认真阅读下列短文,并根据所读内容在文章后表格中的空格里填入一个最恰当的单词。注意:每个空格只填一个单词。请将答案写在答题卡上相应的横线上。
Maybe you are an average student. You probably think you will never be a top student. This is not necessary so, however. Anyone can become a better student if he or she wants to. Here’s how:
1. Plan your time carefully. When you plan your week, you should make a list of things that you have to do. After making this list, you should make a schedule of your time. First your time for eating, sleeping, dressing, etc. then decide a good, regular time for studying. Don’t forget to set aside enough time for entertainment. A weekly schedule may not solve all your problems, but it will force you to realize what is happening to your time.
2. Find a good place to study. Look around the house for a good study area. Keep this space, which may be a desk or simply a corner of your room, free of everything but study materials. No games, radios, or television! When you sit down to study, concentrate on the subject.
3. Make good use of your time in class. Take advantage of class time to listen to everything the teachers say. Really listening in class means less work later. Taking notes will help you remember what the teacher says.
4. Study regularly. When you get home from school, go over your notes. Review the important points that your teacher mentioned in class. If you know what your teacher is going to discuss the next day, read that material will become more meaningful, and you will remember it longer.
5. Develop a good attitude about tests. The purpose of a test is to show what you have learned about a subject. They help you remember your new knowledge. The world won’t end if you don’t pass a test, so don’t be overly worried.
There are other methods that might help you with your studying. You will probably discover many others after you have tried these.
How to become a better student
General method
How to
Advantage
Plan your time carefully
Make a list
Force you to realize(6) ____ is happening to your time
Make a (1) ______
Find a good place to study
Free of everything but study (2) ______
You can (7) ______on the subject
Make good use of your time in class
Listen to everything the teachers say
Really listening in class means (8) ______ work later
Taking (3) ______
Study regularly
Go over your notes
 
(4) ______ new material
Help you (9) _____it better , remember it longer
Develop a good attitude about tests
Don’t be (5) ______ worried
Remember your new
(10) ______
单项选择题