解密和加密函数
#include<iostream.h>
char *f1()
{char a[]={"the result of 3 and 2 is not 8"};
int b[7]={4,9,6,2,8,7,3};
int i=0,j=-1;
while(a[i]!='\0')
{if((a[i]+b[(j+1)%7])>122)
a[i]=(a[i]+b[(j+1)%7])%122;
else a[i]=a[i]+b[(j+1)%7];
i++;j++;
}
return a;
}
void f2()
{
char *b;
int a[7]={4,9,6,2,8,7,3};
b=f1();
int i=0;
int j=-1;
while((*b)!='\0')
{ if(*b<32)
*b=*b+122-a[(j+1)%7] ;
else *b=*b-a[(j+1)%7];
b++;j++;
}
for( i=0;(*b)!='\0';i++)
cout<<*b++;
cout<<endl;
}
void main()
{
f2();
}
the result of 3 and 2 is not 8将每个字符依次反复加上4962873