#include<stdio.h>
#include<stdlib.h>
#include<string.h>
const int lowRol[2][26] = { {24, 25, 26, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 } ,
{ 21, 3, 15, 1, 19, 10, 14, 26, 20, 8, 16, 16, 7, 22, 4, 11, 5, 17, 9, 12, 21, 22, 23, 24, 25, 26} };
const int midRol[2][26] = { {26, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 1} ,
{ 20,1, 6, 4, 15, 3, 14, 12, 23, 5, 16, 2, 22, 19, 11, 18, 25, 24, 13, 7, 10, 8, 21, 9, 26, 17} };
const int fastRol[2][26] = { {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26} ,
{ 8, 26, 17, 20,22,10, 3, 13, 11, 4, 23, 5, 24, 9, 12, 25, 16, 19, 6, 15, 21, 2, 7, 1, 4, 14} };
// 实现转轮功能
void m_change(int word[2][26]) {
int temp_a, temp_b;
int i;
temp_a = word[0][0];
temp_b = word[1][0];
for (i = 0; i < 25; i++) {
word[0][i] = word[0][i + 1];
word[1][i] = word[1][i + 1];
}
word[0][25] = temp_a;
word[1][25] = temp_b;
}
void get_ciper(char text[100], char output[100], int lowrol[2][26], int midrol[2][26], int fastrol[2][26]) {
int i;
int fcnt = 0; int mcnt = 0;
int input_i, low_flag, mid_flag, fast_flag;
//第一层循环 ,遍历全部的字符
for (i = 0; i < strlen(text); i++) {
input_i = (int)(text[i] - 97);
if (text[i] == '