网站大量收购独家精品文档,联系QQ:2885784924

数字或字符移位后的计算(Numeric or character shift calculation).doc

数字或字符移位后的计算(Numeric or character shift calculation).doc

  1. 1、本文档共23页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 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

文档评论(0)

jgx3536 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:6111134150000003

1亿VIP精品文档

相关文档