C++ 解密古罗马密码:替换与排列加密的验证程序
///'///'///'//n#include ///'iostream///'//n#include ///'string///'//nusing namespace std;//n//nstring substitutionEncrypt(string text) {//n for (int i = 0; i < text.length(); i++) {//n if (text[i] == //'Z//') {//n text[i] = //'A//';//n }//n else {//n text[i] = text[i] + 1;//n }//n }//n return text;//n}//n//nstring permutationEncrypt(string text, string order) {//n string encryptedText = text;//n for (int i = 0; i < order.length(); i++) {//n encryptedText[i] = text[order[i] - //'1//'];//n }//n return encryptedText;//n}//n//nint main() {//n string encryptedText, decryptedText;//n cin >> encryptedText >> decryptedText;//n//n string substitutionResult = substitutionEncrypt(decryptedText);//n string permutationResult = permutationEncrypt(substitutionResult, ///'2154376910///');//n//n if (permutationResult == encryptedText) {//n cout << ///'YES///' << endl;//n }//n else {//n cout << ///'NO///' << endl;//n }//n//n return 0;//n}//n///'///'///
原文地址: https://www.cveoy.top/t/topic/pUVX 著作权归作者所有。请勿转载和采集!