大神勿喷啊!!!!代码里的1.txt就是你要加密的文件
#include <stdio.h> int main(int argc, const char * argv[]) { FILE *fpRead = fopen("/Users/apple/Desktop/1.txt”, "r"); FILE *fpWrite = fopen("/Users/apple/Desktop/工作文件.txt”, "w"); if(fpRead){ if(fpWrite){ while (1) { int byte = fgetc(fpRead); if(byte == EOF){ break; } byte--; fputc(byte, fpWrite); } puts("加密成功"); fclose(fpWrite); } fclose(fpRead); }
return 0; }
|