没怎么理解,随便写一个
#include
#include
#include
#include
void w(char name[10],char s[100],int n)
{
if(n>0)
n-=1;
FILE *fp;
fp=fopen(name,"w");
int i;
for(i=0;s[i];i++)
s[i]+=n;
fprintf(fp,"%s",s);
fclose(fp);
}
void r(char name[10],int n)
{
if(n>0)
n-=1;
char s[100];
int i;
FILE *fp;
fp=fopen(name,"r");
fscanf(fp,"%s",s);
for(i=0;s[i];i++)
printf("%c",s[i]-n);
printf("\n");
}
int main()
{
int n,i,j,m;
char s[100];
scanf("%d",&n);
scanf("%s",s);
w("1.txt",s,n);
scanf("%d",&m);
r("1.txt",m);
return 0;
}