皮皮学,免费搜题
登录
搜题
【简答题】
函数ReadDat()的功能是实现从文件ENG9.IN中读取一篇英文文章,存入到字符串数组xx中。请编制函数encryptChar(),按给定的替代关系对数组xx中的所有字符进行替代,仍存入数组xx的对应的位置上, 替代关系:f(p)=p*11 mod 256(p是数组xx中某一个字符的ASCII值,f(p)是计算后新字符的ASCII值),如果原字符的ASCII值是偶数或计算后f(p)的值小于等于32,则该字符不变,否则将f(p)所对应的字符进行替代。 注意:部分源程序已给出,原始数据文件存放的格式是:每行的宽度均小于80个字符。 请勿改动主函数main()、读函数ReadDat()和写函数WriteDat()的内容。 试题程序: include <stdio.h> include <string.h> include <conio.h> include <ctype.h> unsigned char xx[50] [80]; int maxline = 0; /* 文章的总行数 */ int ReadDat(void); void WriteDat(void); void encryptChar() { } main ( ) { clrscr(); if (ReadDat ()) { printf ('数据文件ENG9. IN不能打开 ! /n/007 '); return; } encryptChar(); WriteDat(); } int ReadDat (void) { FILE *fp; int i= 0; unsigned char *p; if ((fp = fopen('ENG9.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('PS9.DAT', 'w'); for(i = 0; i < maxline; i++) { printf('%s/n', xx[i]); fprintf(fp, '%s/n', xx[i]); } fclose (fp); }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】气体栓塞产生的原因是
A.
附加压强
B.
流量
C.
红细胞聚集性
D.
流阻
【判断题】1905 年11月孙中山在《民报》发刊词中把同盟会的纲领概括为民族主义、民权主义、民生主义。()
A.
正确
B.
错误
【单选题】水准仪置于 A 、B两点中间, A 尺读数 a=1.523m , B 尺读数 b=1.305m ,仪器移至 A 点附近,尺读数分别为a′= 1.701m ,b′= 1.462m ,则 ( )
A.
. LL ∥ CC ;
B.
. LL 不∥ CC ;
C.
. L ′ L ′∥ VV ;
D.
. L ′ L ′不∥ VV ;
【单选题】question 2: Which of the following is true of the OECD report?
A.
It criticizes government-funded research.
B.
It introduces an effective means of publication.
C.
It upsets profit-making journal publishers.
D.
It benefits scientific research considerably.
【判断题】气体栓塞的产生原因是液体分子的表面张力。
A.
正确
B.
错误
【单选题】气体栓塞产生的原因是
A.
流阻
B.
流量
C.
红细胞聚集
D.
附加压强
【单选题】Question 9 Which of the following can you conclude from the logistic map bifurcation diagram?
A.
When R is between 2.4 and 3.0, the logistic map has a fixed point that increases as R increases.
B.
When R is between 3.0 and 3.4, the logistic map has a period-2 attractor in which, as R increases, the two values in the attractor get closer together.
【单选题】Question 2: Which of the following statements is FALSE?
A.
Four security officers were killed in Medina when a suicide bomber detonated a device near the Prophet’s Mosque.
B.
Another suicide bomber struck near a US consulate in Jeddah during the midnight.
C.
Both of the explosions in Medina and Qatif happened almost simultaneously.
D.
It’s not the first time for the Islamic State group to have such a strike in Saudi Arabia.
【简答题】细胞中同时存在几种骨架体系有什么意义?是否是物质和能量的一种浪费?
【单选题】气体栓塞产生的原因是
A.
流阻
B.
流量
C.
红细胞聚集性
D.
附加压强
相关题目: