题目内容

函数readDat()的功能是从文件in52.dat中读取20行数据存放到字符串数组xx中(每行字符串的长度均小于80)。请编制函数JsSort(),该函数的功能是:以行为单位对字符串变量的下标为奇数位置上的字符按其ASCII值从小到大的顺序进行排序,排序后的结果仍按行重新存入字符串数组xx中,最后调用函数 wfiteDat()把结果xx输出到文件out52.dat中。
例如: 位置 0 1 2 3 4 5 6 7
源字符串 h S f e d c b a
则处理后字符串 h a f c d e b g。
注意:部分源程序已给出。
请勿改动主函数main()、读函数readDat()和写.函数writeD6L()的内容。
试题程序:
include
include
include
char XX[20][80];
void isSort()
{
}
void main()
{
readDat();
jsSort();
writeDat();
}
readDat()
{
FILE *in;
int i=0;
char *p;
in=fopen("in52.dat","r");
while(i<20 && fgets(xx[i] 80,in)!=NULL)
{
p=strchr(xx[i],'\n');
if(p) ap=0;
i++;
}
fclose(in);
}
writeDat ()
{
FILE *out;
int i;
ut=fopen("out52.dat","w");
clrscr();
for(i=0;i<20;i++)
{
printf("%s\n",xx[i]);
fprintf(out,"%s\n",xx[i]);
}
fclose(out);
}

查看答案
更多问题

社会上对养老有两种观点,一是养老院模式,一是家庭养老,你怎么看?

SECTION B ENGLISH TO CHINESE
Directions: Translate the following text into Chinese.
She was very handsome, with a certain fine, rich coloring that belongs to the healthy brunet type. She was quite composed, as she idly stroked the satiny coat of the cat that lay curled in her lap, and she occasionally sent a slow glance into the shadow where her companion sat. They were talking low, of indifferent things which plainly were not the things that occupied their thoughts. She knew that he loved her--a frank, blustering fellow without guile enough to conceal his feelings, and no desire to do so. For two weeks past he had sought her society eagerly and persistently. She was confidently waiting for him to declare himself and she meant to accept him. The rather insignificant and unattractive Brantain was enormously rich; and she liked and required the entourage which wealth could give her.

Any two networks in piconets is unlikely be on the same frequency at the same time because

试论述行政监督系统的构成。

答案查题题库