【练习12-2】改写例12-2,加密规则改为例7-12中的恺撒密码。#includestdio.h #includestring.h #includestdlib.h struct sysuser{ char username[20]; char password[10]; }; void encrypt(char *pwd,int offset); int main(){ struct sysuser user; FILE *fp; int offset; if((fpfopen(userkaisa.txt,w))NULL){ printf(File open error!\n); exit(0); } int i; for(i1;i5;i){ printf(The username and password of NO.%d:,i); scanf(%s %s%d,user.username,user.password,offset); encrypt(user.password,offset); fprintf(fp,%s %s\n,user.username,user.password); } if(fclose(fp)){ printf(Can not close the file!\n); exit(0); } return 0; } void encrypt(char *pwd,int offset){ int i; offsetoffset%26; for(i0;istrlen(pwd);i){ if(pwd[i]apwd[i]z) pwd[i](pwd[i]offset-a)%26a; if(pwd[i]Apwd[i]Z) pwd[i](pwd[i]offset-A)%26A; } }