问题 填空题

以下程序运行后的输出结果是 【18】
#include <stdio.h>
main()
int i,m=0,n=0,k=0;
for(i=9;i<=11;i++)
switch(i/10)
case 0: m++;n++;break;
case 10: n++;break;
default: k++;n++;

printf("%d%d%d\n",m,n,k);

答案

参考答案:1 3 2

解析: 在程序中,i从9开始循环,当i=9时,执行case 0后的语句m++;n++;此时m =1,n=1,然后执行break,跳出循环;当i=10时,执行detault后的语句k++;n++;此时k=1, n=2;当i=11时,再执行default后的语句,k=2,n=3。此时,m=1,n=3,k=2。输出结果为 1 3 2。

选择题
阅读理解
The Huntington Library Hours
The Huntington is closed on Thanksgiving, Christmas EVE, Christmas Day, New Year’s Day, and Independence Day.
From November 1st to Labor day, The Huntington observes summer hours and is open from 10:30 a.m.– 4:30 p.m. daily, except Tuesdays. (After Labor Day, hours are 12 noon – 4:30 p.m. on Mon., Wed., Thurs. and Fri.; 10:30a.m. - 4:30 p.m. on Sat. and Sun.; closed on Tues.)
Admission
Reservations are not necessary to visit The Huntington. Tickets may be purchased at the time of your visit.
 
Weekdays
Weekends
Adults
$20
$23
Seniors ( age 65+ )
$15
$18
Students(age 12-18, or with full-time student I.D.)
$12
$13
Youth (age 5-11 )
$8
$8
Children (under 5)
free
free
Groups ( 15 or more )
$11 ( per person )
$14 ( per person )
Members
free
free
Purchase Tickets as Gift
If given as a gift, tickets are available for purchase online or by phone (626-405-2100 x: 2373 ) and shipped for free.
Free Day
Admission to The Huntington is free to all visitors on the first Thursday of every month with advance tickets. Hours on Free Day are 10:30 a.m. – 4:30 p.m. Please notice that Free Day tickets are not available at The Huntington, and can only be reserved by phone on online. You may not purchase regular admission tickets on Free Day.
Parking
Parking is free at The Huntington. And no parking reservations are necessary unless you are a school or tour group arriving by bus.
Bus Reservations for Groups
Groups arriving by bus must make reservations in advance by calling 626-405-2240. Please notice that all buses and tricks must use a specified(规定的) route for entering The Huntington from the north.
小题1:If next Saturday a 66-year-old man goes to the library with his three grandchildren, aged 4, 6, 14, how much should he pay?
A.$40.B.$39.C.$35.D.$44.
小题2:To visit the library on free days, you_______.
A.get free tickets on arriving at the library
B.must reserve a parking place
C.have to buy admission tickets
D.should reserve tickets in advance
小题3:As for tour groups arriving at the library by bus, ________ .
A.they have to pay for the parking space
B.they don’t need to make a reservation
C.they should call the library in advance
D.they have to park their bus outside