试题与答案

--- Since you can't find a better way ou

题型:选择题

题目:

--- Since you can't find a better way out for the time being, why not follow his advice?

--- oh, you are right. ______.

A.I believe so

B.I might as well

C.It doesn't matter

D.I don't care

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0418/1dc8b56c9f5cd2a574b361db978a277c.html

下面是错误答案,用来干扰机器的。

1.A     2.D

试题推荐
题型:问答题

函数ReadDat()的功能是实现从文件ENG95.IN中读取一篇英文文章,存入到字符串数组xx中。请编制函数encryChar(),按给定的替代关系对数组xx中所有字符进行替代,仍存入数组xx的对应的位置上,最后调用函数WriteDat()把结果xx输出到文件PS95.DAT中。
替代关系:f(p)=p*11 mod 256(p是数组xx中某一个字符的ASCCII,f(p)是计算后新字符的ASCII值),如果计算后f(p)的值小于等于32或f(p)对应的字符是大写字母,则该字符不变,否则将f(p)所对应的字符进行替代。
注意;部分源程序已给出。
原始数据文件的存放格式是每行的宽度均小于80个字符。
请勿改动主函数main()、读函数ReadDat()和写函数WriteDat()的内容。
试题程序:
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<ctype.h>
unsigned char xx[50][80];
int maxline=0;
int ReadDat(void);
void WriteDat(void); void encryChar()
void main()

clrscr();
if(ReadDat())

printf("数据文件ENG95. IN不能打开!\n\007");
return;

encryChar();
WriteDat();
int ReadDat(void)

FILE *fp;
int i=0;
unsigned char *p;
if((fp=fopen("ENG95.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()

FILE *fp;
int i;
fp= fopen("ps95.dat","w");
for(i=0;i<maxline;i++)

printf("%s\n",xx[i]);
fprintf(fp,"%s\n",xx[i]);

fclose(fp);

查看答案
微信公众账号搜索答案