找考题网-背景图
未分类题

下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]='Hello,Test'; char *p=a; while(*p) { if(*p>='a'&&*p<='’z') cout<<char(*p+'A'-'a'); else cout<<*p; p++; } return 0; }
D.hELLO,tEST

A.hello,test
B.Hello,Test
C.HELLO,TEST

【参考答案】

C
解析:用一个指针变量p指向字符数组a,在while循环中,当不指向数组尾时,将小写字母转换为大写字母,然后将其输出。
热门试题

未分类题Culture is the sum total of all the traditions, customs, beliefs, and ways of life of a given group of human beings. In this (1)_____, every group has a culture, however un-developed or uncivilized it may seem to us.To the professional anthropologist, there is no intrinsic superiority of one culture (2)_____ another, just as to the professional linguist there is no intrinsic (3)_____ among the different languages.People once (4)_____ the languages of backward groups as savage, undeveloped (5)_____ of speech, consisting largely of grunts and groans. (6)_____ it is possible that language (7)_____ began as a series of grunts and groans, it is a fact established by the study of 'backward' languages (8)_____ no spoken tongue answers that description today. Most languages of (9)_____ groups are, by our most severe standards, extremely (10)_____, delicate, and ingenious pieces of machinery for the transfer of ideas. They (11)_____ behind our Western languages not in their sound patterns or grammatical structures, which usually are fully adequate for all language needs, (12)_____ only in their vocabularies, which reflect their speakers' social (13)_____.Even in this department, (14)_____, two things are to be noted: 1) All languages seem to (15)_____ the machinery for vocabulary expansion, either by putting together words already in existence (16)_____ by borrowing them from other languages and adapting them to their own system. 2) The objects and activities requiring names and (17)_____ in 'backward' languages, while different from ours, are often (18)_____ numerous and complicateD.A Western languages distinguishes merely between two degrees of remoteness ('this' and 'that'); some languages of the American Indians distinguish between what is close to the speaker or to the person (19)_____ and what is removed from both, or out of sight, or in the past, or in the futurE.This study of language, in turn, (20)_____ a new light upon the claim of the anthropologists that all cultures are to be viewed independently, and without ideas of rank.A.perspectiveB.senseC.dimensionD.manner

A.B.
C.
D.
E.
A.perspective
B.sense
C.dimension