张倩霖吧 关注:2贴子:53
  • 1回复贴,共1
#include<stdio.h>
#include<stdlib.h>
void shuru(){
FILE *cfptr;
char word;
if((cfptr=fopen("wenjian.dat","w"))==NULL)
printf("文件不能被打开或建立\n");
else{
scanf("%c",&word);
}
fclose(cfptr);
} void main(){
int s;
scanf("%d",&s);
while(s!=0)
{
printf("**********************************************************\n");
printf("* *\n");
printf("* 1--输入 2--加密 3--解密 4--显示 5-统计 0--退出 *\n");
printf("* *\n");
printf("********************************************************** \n");
}
if(s<0||s>5)
printf("please input 0~5");
}


IP属地:福建1楼2013-07-08 10:46回复
    #include<stdio.h>#include<stdlib.h>#define max 100void 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;
    } }


    IP属地:福建2楼2013-07-08 16:14
    回复