问题 填空题

以下程序的功能是输入任意整数给n后,输出n行由大写字母A开始构成的三角形字符阵列图形。例如,输入整数5时(注意:n不得大于10),程序运行结果如下:
A B C D E
F G H I
J K L
M N
O
请填空完成该程序。
main()
int i,j,n;char ch=’A’;
scanf("%d",&n);
if(n<11)
for(i=1;i<=n;i++)
for(j=1;j<n-i+1;j++)
printf("%2c",ch);





else printf("n is too large!\\n")
printf("\\n");

答案

参考答案:ch++,printf(“\n”);

解析: C语言允许字符数据与整数进行直接的算术运算,故输出大写字母A开始的连续字符,可通过白加运算ch++完成。三角形字符阵列第i行的字符个数为n-i+1,在每行结尾以回车字符‘\n’换行。

选择题
单项选择题

El Nino is the term used for the period when sea surface temperatures are above normal off the South American coast along the equatorial Pacific, sometimes called the Earth’s heartbeat, and is a dramatic but mysterious climate system that periodically rages across the Pacific.

El Nino means "the little boy" or "the Christ child" in Spanish, and is so called because its warm current is felt along coastal Peru and Ecuador around Christmas. But the local warming is just part of an intricate set of changes in the ocean and atmosphere across the tropical Pacific, which covers a third of the Earth’s circumference. Its intensity is such that it affects temperatures, storm tracks and rainfall around the world.

Droughts in Africa and Australia, tropical storms in the Pacific, torrential rains along the Californian coast and lush greening of Peruvian deserts have all been ascribed to the whim of EI Nino. Until recently it has been returning about every three to five years. But recently it has become more frequent--for the first time on record it has returned for a fourth consecutive year--and at the same time a giant pool of unusually warm water has settled down in the middle of the Pacific and is showing no signs of moving.

Climatologists don’t yet know why, though some are saying these aberrations may signal a worldwide change in climate. The problem is that nobody really seems sure what causes the El Nin o to start up, and what makes some per than others. And this makes it particularly hard to explain why it has suddenly started behaving so differently.

In the absence of EI Nino and its cold counterpart, La Nina, conditions in the tropical eastern Pacific are the opposite of those in the west. the east is cool and dry, while the west is hot and wet. In the east, it’s the winds and currents that keep things cool. It works like this. Strong, steady winds, called trade winds, blowing west across the Pacific drag the surface water along with them. The varying influence of the Earth’s rotation at different latitudes, known as the Coriolis effect, causes these surface winds and water to veer towards the poles, north in the northern hemisphere and south in the southern hemisphere. The surface water is replaced by colder water from deeper in the ocean in a process known as upwelling.

The cold surface water in turn chills the air above it. This cold dense air cannot rise high enough for water vapor to condense into clouds. The dense air creates an area of high pressure so that the atmosphere over the equatorial eastern Pacific is essentially devoid of rainfall.

In exploring the effect of EI Nino, the author mainly focuses on()

A. its violence

B. its conditions

C. its regularity

D. its features