#include<iostream>
using namespace std;
//将一行电文按规律译成密码
int main()
{
char str[100];
cout << "请输入电文:";
gets_s(str);
cout << "原文:" << str << endl;
for (int i = 0; str[i] != '\0'; ++i)
{
if (str[i] >= 'A' && str[i] <= 'Z')
str[i] = 155 - str[i];
else if (str[i] >= 'a' && str[i] <= 'z')
str[i] = 219 - str[i];
else str[i] = str[i];
}
cout << "密码:" << str << endl;
return 0;
}