问题 单项选择题

有以下程序
#include<stdio.h>
#include<string.h>
main()
char a[5][10]="china","beijing","you","tiananmen","welcome");
int i,j; char t[10];
for(i=0;i<4;i++)
for(j=i+1;j<5;j++)
if(strcmp(a[i],a[j])>0)
strcpy(t,a[i]);strcpy(a[i],a[j]);strcpy(a[j],t);
puts(a[3]);

程序运行后的输出结果是( )。

A)Beijing
B)china
C)welcome D)tiananmen

答案

参考答案:C

解析: 由程序中的两层for循环可知,对数组串数组进行从小到大的排序,所以字符串数组a[][],经过排序后值应该为{"beijing","china","tiananmen","welcome","you"),输出字符串a[3]的值为“welcome”。

填空题


A Sports体育运动
Many animals engage in play,but homo sapiens is the only animal (1) have invented sports.Since sports are an invention,a part of culture (2) than an aspect of nature,all definitions of sports are somewhat arbitrary. (3) sports are a human universal found in every known culture or a (4) unique to modern society depends upon one’s definition of sports.Men and (5) have always run,jumped,climbed,lifted,thrown, and wrestled,but they have (6) always performed these physical activities competitively. Although all literate societies seem to (7) contests of one sort or another in which men, and sometimes women, (8) in displays and tests of physical skill and prowess,sports may be (9) defined as physical contests performed for their own sake and not for (10) ulterior end.According to this strict definition,neither Neolithic hunters nor contestants (11) religious ceremonies such as the ancient Olympic Games were engaged in sports. (12) on the stipulation that sports must be performed for their own sake (13) the paradoxical elimination of many activities which are usually thought of as (14) ,such as exercises done for the sake of cardiovascular fitness,races run (15) satisfy a physical education requirement,ball games played to earn a paycheck. (16) definition also means abandonment of the traditional usage in which"sport,"derived (17) Middle English disporter,refers to any light hearted recreational activity.In the. (18) of some 18th- century aristocrats,a game of backgammon and the seduction of (19) milkmaid were both considered good sport,but this usage of the term (20) become archaic.

单项选择题