题目内容

函数ReadDat()用于实现从文件ENG.IN中读取一篇英文文章,并将其存入字符串数组xx中。请编制函数encryptChar(),按给定的替代关系对数组xx中所有的字符进行替代,结果仍存入字符串数组xx的对应位置,最后调用函数WriteDat()把结果数组xx输出到文件PS3.DAT中。 替代关系:f(p)=p*17 rood 256(p是数组中某一个字符的ASCⅡ值,f(p)是计算后新字符的ASCⅡ值)。如果计算后f(p)的值小于32或其ASCⅡ值是奇数,则该字符不变,否则将f(p)所对应的字符进行替代。 原始数据文件的格式为:每行的宽度均小于80个字符。 注意:部分源程序给出如下。 请勿改动主函数main()、读数据函数ReadDat()和输出数据函数WriteDat()的内容。 [试题源程序] #include<Stdio.h> #include<string.h> #inciude<conio.h> #include<ctype.h> unsigned char xx[50][80]; int maxline=0; /*文章的总行数*/ int ReadDat(void); VOid WriteDat(void); void encryptChar() void main() system("cls"); if(ReadDat()) printf("数据文件ENG.IN不能打开!\n\007"); return; encryptChar(); WriteDat(); int ReadDat(void) FILE *fp; int i=0; unsigned char *P; if((fp=fopen("eng.in","r"))==NULL) return 1; while(fgets(xx[i],80,fp)!=NULL) p=strchr(xx[i],’\n’); if(P) *p=0; i++; maxline=i; fclose(fp); return 0; void WriteDat(void) FILE *fp; int i; fp=fopen("ps.dat","w"); for(i=0;i<maxline;i++) printf("%s\n",xx[i]); fprintf(fp,"%s\n",xx[i]); fclose(fp);

查看答案
更多问题

We should be (consider) of the comfort of old people.

Now that you are not able to speak English freely,you had better choose simple words and sentences to make yourself understood when you talk with others in English()

A. 你现在不能随便说英语,如果需要用英语和别人谈话的时候,最好还是挑选简单的单词和句子,这样你自己就可以得到别人的理解了。
B. 现在,你还无法随意地说英语,当你用英语和别人交流时,最好还是选择简单的词汇和句子,以便别人能够明白你的话。
C. 既然你现在还不能自由地说英语,所以你在用英语和别人谈话时,最好还是挑选简单的单词和句子,以便使你自己被别人明白。
D. 既然你还无法随意地说英语,在你用英语和别人交谈时,最好还是选择简单的词汇和句子,让别人能听懂。

Bob wishes be (see) the football game instead of the film.

Section A Directions: This section is to test your ability to understand short dialogues. There are 5 recorded dialogues in it. After each dialogue, there is a recorded question. Both the dialogues and questions will be spoken only once. When you hear a question, you should decide on the correct answer from the 4 choices marked A), B), C) and D) given in your test paper. Then you should mark the corresponding letter on the Answer Sheet with a single line through the center.

A. Play the music more quietly.
B. Stop talking so loudly.
C. Turn off the radio.
D. Give the man a hand.

答案查题题库