#include<stdio.h> #define KEY '0' void fun(char *str) { for (char *p = str; *p ; p++) { *p ^= KEY; } } int main() { char test[] = "Hello World!"; fun(test); printf("加密:\t%s\n", test); fun(test); printf("解密:\t%s\n", test); return 0; }