给出一种加密算法如下:输入原文,将原文看做一个循环队列生成n个字符串,
对这n个串按首字母稳定排序,取每个串的尾字母做为密文。
例如:输入example,得到7个字符串如下:
example,
xamplee,
ampleex,
mpleexa,
pleexam,
leexamp,
eexampl,按首字母稳定排序后得到:
ampleex,
example,
eexampl,
leexamp,
mpleexa,
pleexam,
xamplee,取每个串的尾字母,得到密文xelpame,现在要求输入一个原文对其加密,或输
入一个密文对其解密。
这个排序后就不知道原本的顺序了,没办法解密了吧。