问题 单项选择题

有以下程序:
#include<stdio.h>
main()
FILE *fp; int k, n, a[6]=1, 2, 3, 4, 5, 6;
fp=fopen("d2. dat", "w");
fprintf(fp, "%d%d%d% d\n", a[0], a[1], a[2]);
fprintf(fp, "%d%d% d\n", a[3], a[4], a[5]);
fclose(fp); fp=fopen("d2.dat", "r");
fscanf(fp, "%d%d", &k, &n);
printf("%d%d\n", k, n);
fclose(fp);

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

A) 1
B) 12 4
C) 123 4
D) 123 456

答案

参考答案:D

解析: 将有6个元素的整型数组分两行输出到一个文件中,因为输出的都是数字并且每行都没有分隔符,所以当再对其进行读取操作时,每一行都会被认为是一个完整的数,而换行符则作为它们的分隔符。

单项选择题
阅读理解

Most of the flowers in nature are red, orange and yellow. If we have seen a black flower, it’s a chance in a million.

People have made a census (普查) to colors of mor e than four thousand kinds of flowers and discovered that only eight of them are black.

As we know, sunlight is formed by seven different colored lights.The wave length of each light is different, so the quantity of heat in each light is also different. Flowers, especially their petals, are easy to be harmed by light temperature.

Black flowers can take in all the light waves which cause the flowers to dry up in the high temperature. So black flowers can rarely survive sunlight. But red flowers, yellow flowers and orange flowers can protect themselves from sunlight by reflecting the red light, yellow light and orange light, each of which has a large quantity of heat.

1. It is _____ to see a black flower.

A. impossible     B. seldom          C. common       D. no chance

2. From the passage we know that _______.

A. black flowers are so weak that it is difficult for them to grow up.

B. there are only eight black flowers in nature

C. sunlight is formed by seven different colored lights, so the wave length of each light is different

D. black flowers can take in the light of all the wave length which makes them dry up because of high temperature

3. Which of the following ideas is WRONG?

A. People have found that only a few kinds of flowers are black.

B. Flowers are easy to be harmed by very high temperature.

C. Red, orange and yellow flowers can also take in the light of all wave lengths.

D. The black flowers can’t protect themselves from sunlight.