- 1、本文档共23页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
数字或字符移位后的计算(Numeric or character shift calculation)
数字或字符移位后的计算(Numeric or character shift calculation)
21 questions
The function ReadDat () to read a English article from the IN.DAT file into an array of strings in XX, please prepare the function CharConvA (), its function is: in units of the last character in the string and the ASCII value of the right 4 after the last second characters of ASCII, the last a new character, the last second characters of the ASCII value of right 4 after the last third characters of ASCII value, finally get second new characters, and so on have been treated to second characters, the first character of the ASCII value and the original last character of ASCII, was the first of a new character the new character, the original string are stored in the corresponding position. Finally, the string that has been processed is re stored in the string array XX by line, and finally the function writeDat () is called to output the result XX to the file OUT10.DAT.
The format of the original data file is: the width of each row is less than 80 characters, including punctuation and spaces.
Some source programs have been given.
Do not change the contents of the main function main () and the write function writeDat ().
#includestdio.h
#includestring.h
#includeconio.h
Char xx[50][80];
Int maxline=0; the total number of articles / *
Int ReadDat (void)
Void WriteDat (void)
Void, CharConvA ()
{
}
Void, main ()
{
Clrscr ();
If (ReadDat ()) {
Printf (data file ENG.IN cannot be opened! \n\007 ;
Return;
}
CharConvA ();
WriteDat ();
}
Int ReadDat (void)
{
FILE *fp;
Int i=0;
Char *p;
If ((fp=fopen (IN.DAT, 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 (OUT10.DAT, W);
For (i=0; imaxline; i++) {
Printf (%s\n, xx[i]);
Fprintf (FP,%s\n, xx[i]);
}
Fclose (FP);
}
--------------------------------------------------------------------------------
Note: in this question, the main thing i
您可能关注的文档
- 抱拳礼2(Boxing ceremony 2).doc
- 拇指肌腱断了(The tendon of the thumb is broken).doc
- 报孙会宗书(Sun Hui Zong Shu Shu).doc
- 抹茶和绿茶的区别(The difference between green tea and Green Tea.).doc
- 拉丁舞技巧(Latin dance techniques).doc
- 报考呈现六点变化,考情继续高位盘整(Enter oneself for an examination presents six changes, test situation continues to high consolidation).doc
- 拉伸增高法(Stretch increasing method).doc
- 护理综合复习大纲(Comprehensive nursing review program).doc
- 拉布拉多幼年期的训练方法.doc
- 拉延模设计(Drawing die design).doc
最近下载
- 固体废物管理知识培训课件.ppt VIP
- Midjourney 人工智能AI绘画教程:从娱乐到商用 课件 第1章 Midjourney 人工智能绘画简介.pptx
- 某啤酒厂废水处理工艺设计(4000m3d.docx
- 2025年无锡工艺职业技术学院单招职业技能测试题库及1套参考答案.docx VIP
- 高中课件:晶胞投影与原子分数坐标.ppt
- 高考“散文六种常考句段作用”题例解.doc VIP
- 2025年国航机务系统AMECO技术员岗位校园招聘笔试参考题库附带答案详解.pdf
- 中国翻译服务规范.PDF
- (高清版)DB33∕T 2080-2017 文化馆服务规范 .pdf VIP
- 2024年无锡工艺职业技术学院单招职业技能测试题库(全优).docx VIP
文档评论(0)