阅读以下说明和C语言函数,将应填入(n)处的字句写在答题纸的对应栏内。
【说明】
假设一个剧场有N*N个座位,顾客买票时可以提出任意有效的座号请求。下面用二维数组a[N][N]模拟剧场中的座位,a[i][j]圆等于0表示
第i排第j列(0≤i,j≤N-1)的票尚未售出。
函数int Find(int a[][N],int R,int*row,int*col)的功能是:在部分票已售出的情况下,找出剧场中的R*R个空座位,要求这些座位
的排列形成一个正方形。若找到满足要求的一个座位排列,则函数返回1,并算出该正方形左上角的行、列号;若未找到,则返回0。
例如,一个7X7个座位的剧场如下图(a)所示,已售出部分座位的剧场如下图(b)所示,图中阴影部分表示已售出的座位,从下图(b)中找出
的3X3正方形空座位如下图(c)中斜线区所示。
【函数】
int Find(int a[][N] int R,int*row,iht*col)
{int i,j,k,c,t;int FOUND=0;
for(i=0;!FOUND&&i<N-R+1;i++) { /*从第0排开始查找*/
(1);
while (j<N-R+1&&!FOUND) {
for (k=0;(2)&&a[i][j+k]==0;k++); /*查找第i排连续的R个空座位*/
if (k>=R) { /*找到第i排连续的R个空座位*/
for (c=0;c<R;c++) { /*查找其余的R*(R-1)个座位*/
for (t=1;t<R;t++)
if (a[(3)][j+c]!=0) break;
if (t<R) break;
}/*for*/
if ((4)) FOUND=1;
}/*if*/
(5;
}/*while*/
}/*fori*/
if (FOUND) {
*row=i-1; *col=j-1; /*计算正方形区域的左上角坐标*/
return 1;
}
return 0;
}
听力原文:F: Good morning, Emperor Hotel, Conference Center. Can I help you?
M: Hello, this is Jerald Seward from MSU. We are going to bold an international symposium on global business at the end of this month and we want to book some conference rooms.
F: No problem. Just a moment, I need to write down some details. Your name, please?
M: Jerald Seward. That's J-E-R-A-L-D Seward, S-E-W-A-R-D. The contact number is 9643-74961.
F: When exactly do you want to book?
M: January 29th to 31st, three days.
F: OK, what kind of rooms do you want?
M: Well, we have about 230 participants. I think we need four mid-sized rooms with multi-media equipment. Each room can hold 50 to 60 people.
F: I am sorry, we only have three mid-sized rooms available at that time. But we have a big one which can hold 100 people.
M: Well, since there is no enough room, that will be OK. By the way, how do you charge?
F: It's $300 for mid-sized rooms and $400 for the big one per day. If you have the membership, we can give you a 20% discount.
M: Oh, yes, we do have the membership. So that would be $240 for a mid-sized room and $320 for a big room per day. Does that include tea, coffee, and snacks?
F: No, you have to pay extra for that. $10 per person each day if you want that.
M: Oh, no, I think I'll save that. Can you transfer payment from our account?
F: Sure, is your account number still MH52775-3218
M: That's right. Thank you, bye.
? Look at the notes below.
? Some information is missing.
? You will hear a man calling to book conference rooms.
? For each question 9-15, fill in the missing information in the numbered space using a word, numbers or letters.
? You will hear the conversation twice.
Emperor Hotel Conference Center
Reservation Form
TYPE OF ROOM BOOKED: (9) three ______ rooms and one big room
DATE OF CONFERENCE: (10) January ______
NUMBER OF PARTICIPANTS: (11) about ______ people
DISCOUNT: (12) ______%
TOTAL PRICE PER DAY: (13) $ ______
CONTACT NAME: (14) ______ Seward
ACCOUNT NUMBER: (15) ______ -3218
(9)