#include
int main()
{char s[200];
int i;
gets(s);
for(i=0;s[i];i++)
s[i]+=i%5+1;
printf("加密后:\n%s\n",s);
for(i=0;s[i];i++)
s[i]-=i%5+1;
printf("解密后:\n%s\n",s);
return 0;
}
Private Sub Command1_Click()
s = InputBox("请输入要加密的字符串:")
Print "输入的字符串是:"
Print s
For i = 1 To Len(s)
Mid(s, i, 1) = Chr(Asc(Mid(s, i, 1)) + i Mod 5 + 1)
Next i
Print "加密后的串:"
Print s
For i = 1 To Len(s)
Mid(s, i, 1) = Chr(Asc(Mid(s, i, 1)) - i Mod 5 - 1)
Next i
Print "解密后的串:"
Print s
End Sub