#include<stdio.h>
#include<stdlib.h>
#define max 100
void shuru(){
FILE *cfptr;
char word[max];
if((cfptr=fopen("D:\\wenjian.dat","w"))==NULL)
printf("文件不能被打开或建立\n");
else{
scanf("%s",&word);
while(!feof(stdin)){
fprintf(cfptr,"%s",word);
scanf("%s",&word);
fclose(cfptr);
}}
}
void main(){
int s;
do
{
printf("**********************************************************\n");
printf("* *\n");
printf("* 1--输入 2--加密 3--解密 4--显示 5-统计 0--退出 *\n");
printf("* *\n");
printf("********************************************************** \n");
scanf("%d",&s);
}while(s<0||s>5); switch(s)
{
case 1:shuru();break;
case 0:break; }
}
#include<stdlib.h>
#define max 100
void shuru(){
FILE *cfptr;
char word[max];
if((cfptr=fopen("D:\\wenjian.dat","w"))==NULL)
printf("文件不能被打开或建立\n");
else{
scanf("%s",&word);
while(!feof(stdin)){
fprintf(cfptr,"%s",word);
scanf("%s",&word);
fclose(cfptr);
}}
}
void main(){
int s;
do
{
printf("**********************************************************\n");
printf("* *\n");
printf("* 1--输入 2--加密 3--解密 4--显示 5-统计 0--退出 *\n");
printf("* *\n");
printf("********************************************************** \n");
scanf("%d",&s);
}while(s<0||s>5); switch(s)
{
case 1:shuru();break;
case 0:break; }
}
