凯撒密码程序.doc

上传人:大张伟 文档编号:10816804 上传时间:2021-06-05 格式:DOC 页数:7 大小:36.50KB
返回 下载 相关 举报
凯撒密码程序.doc_第1页
第1页 / 共7页
凯撒密码程序.doc_第2页
第2页 / 共7页
凯撒密码程序.doc_第3页
第3页 / 共7页
凯撒密码程序.doc_第4页
第4页 / 共7页
凯撒密码程序.doc_第5页
第5页 / 共7页
点击查看更多>>
资源描述

《凯撒密码程序.doc》由会员分享,可在线阅读,更多相关《凯撒密码程序.doc(7页珍藏版)》请在三一文库上搜索。

1、#include#include char JFjiami(char ch,int n)while(ch=A&ch=a&ch=0&ch=A&ch=a&ch=0&ch=A&ch=a&ch=0&ch=A&ch=Z) for(i=0;i=0&h=a&ch=z) for(i=0;i=0&h=0&ch=9) for(i=0;i=0&h=9) return (0+h); return ch;void menu()printf(n=);printf(n 1.JFjiami the file);printf(n 2.CFljiami the file);printf(n 3.JFjiemi the file)

2、;printf(n 4.CFjiemi the file);printf(n 5.Quitn);printf(=n);printf(Please input a number rang from 1 to 5 and select a item:);return;void main()int i,n;char ch0,ch1;FILE *in,*out;char infile20,outfile20;sleep(3);menu();ch0=getch();while(ch0!=5) if(ch0=1) clrscr(); printf(nPlease input the infile:); s

3、canf(%s,infile); if(in=fopen(infile,r)=NULL) printf(Can not open the infile!n); printf(Press any key to exit!n); getch(); exit(0); printf(Please input the key:); scanf(%d,&n); printf(Please input the outfile:); scanf(%s,outfile); if(out=fopen(outfile,w)=NULL) printf(Can not open the outfile!n); prin

4、tf(Press any key to exit!n); fclose(in); getch(); exit(0); while(!feof(in) fputc(JFjiami(fgetc(in),n),out); printf(nJFjiami is over!n); fclose(in); fclose(out); sleep(1); if(ch0=2) clrscr(); printf(nPlease input the infile:); scanf(%s,infile); if(in=fopen(infile,r)=NULL) printf(Can not open the infi

5、le!n); printf(Press any key to exit!n); getch(); exit(0); printf(Please input the key:); scanf(%d,&n); printf(Please input the outfile:); scanf(%s,outfile); if(out=fopen(outfile,w)=NULL) printf(Can not open the outfile!n); printf(Press any key to exit!n); fclose(in); getch(); exit(0); while(!feof(in

6、) fputc(CFjiami(fgetc(in),n),out); printf(nCFjiami is over!n); fclose(in); fclose(out); sleep(1); if(ch0=3) clrscr(); printf(nPlease input the infile:); scanf(%s,infile); if(in=fopen(infile,r)=NULL) printf(Can not open the infile!n); printf(Press any key to exit!n); getch(); exit(0); printf(Please i

7、nput the key:); scanf(%d,&n); printf(Please input the outfile:); scanf(%s,outfile); if(out=fopen(outfile,w)=NULL) printf(Can not open the outfile!n); printf(Press any key to exit!n); fclose(in); getch(); exit(0); while(!feof(in) fputc(JFjiemi(fgetc(in),n),out); printf(nJFjiemi is over!n); fclose(in)

8、; fclose(out); sleep(1); if(ch0=4) clrscr(); printf(nPlease input the infile:); scanf(%s,infile); if(in=fopen(infile,r)=NULL) printf(Can not open the infile!n); printf(Press any key to exit!n); getch(); exit(0); printf(Please input the key:); scanf(%d,&n); printf(Please input the outfile:); scanf(%s

9、,outfile); if(out=fopen(outfile,w)=NULL) printf(Can not open the outfile!n); printf(Press any key to exit!n); fclose(in); getch(); exit(0); while(!feof(in) fputc(CFjiemi(fgetc(in),n),out); printf(nCFjiemi is over!n); fclose(in); fclose(out); sleep(1); menu(); ch0=getch();clrscr(); printf(nGood Bye!n);sleep(3);

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 科普知识


经营许可证编号:宁ICP备18001539号-1