收藏 分享(赏)

凯撒密码程序.doc

上传人:精品资料 文档编号:11189786 上传时间:2020-02-14 格式:DOC 页数:7 大小:36.50KB
下载 相关 举报
凯撒密码程序.doc_第1页
第1页 / 共7页
凯撒密码程序.doc_第2页
第2页 / 共7页
凯撒密码程序.doc_第3页
第3页 / 共7页
凯撒密码程序.doc_第4页
第4页 / 共7页
凯撒密码程序.doc_第5页
第5页 / 共7页
点击查看更多>>
资源描述

1、#include#include char JFjiami(char ch,int n)while(ch=Areturn ch;void menu()printf(“n=“);printf(“n 1.JFjiami the file“);printf(“n 2.CFljiami the file“);printf(“n 3.JFjiemi the file“);printf(“n 4.CFjiemi the file“);printf(“n 5.Quitn“);printf(“=n“);printf(“Please input a number rang from 1 to 5 and sel

2、ect 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:“);scanf(“%s“,infile);if(in=fopen(infile,“r“)=NULL)printf(“Can not open the infile!n“);printf(“Press any key to exit!

3、n“);getch();exit(0);printf(“Please input the key:“);scanf(“%d“,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(JFjiami(fgetc(in),n),out);print

4、f(“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 infile!n“);printf(“Press any key to exit!n“);getch();exit(0);printf(“Please input the key:“);scanf(“%d“,printf(“Pleas

5、e 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(CFjiami(fgetc(in),n),out);printf(“nCFjiami is over!n“);fclose(in);fclose(out);sleep(1);if(ch0=3)clrscr();pr

6、intf(“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“,printf(“Please input the outfile:“);scanf(“%s“,outfile);if(out=fopen(outfile,“w“)=NULL)pr

7、intf(“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);fclose(out);sleep(1);if(ch0=4)clrscr();printf(“nPlease input the infile:“);scanf(“%s“,infile);if(in=fopen(infile,“r“)

8、=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“,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(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);

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

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报