Fdul F Fdul Регистрация 22 Дек 2013 Сообщения 57 Репутация 0 Спасибо 0 Монет 0 9 Ноя 2016 #1 #include "stdafx.h" #include #include using namespace std; int main() { std::string sh = "abcdefghijklmnopqrstuvwxyz"; std::string text; std::string result; int k = 0; int index = 0; void enCode() { for (unsigned i = 0; i < text.length(); i++) for (unsigned j = 0; j < 26; j++) if (text == sh[j]) { index = (3 * k + 4) % 26; //a=3 b=4 result += sh[index]; k = 0; break; } else k++; } void deCode() { for (unsigned i = 0; i < text.length(); i++) for (unsigned j = 0; j < 26; j++) if (text == sh[j]) { index = (9 * (k - 4)) % 26; //a=3 b=4 result += sh[index]; k = 0; break; } else k++; } }
#include "stdafx.h" #include #include using namespace std; int main() { std::string sh = "abcdefghijklmnopqrstuvwxyz"; std::string text; std::string result; int k = 0; int index = 0; void enCode() { for (unsigned i = 0; i < text.length(); i++) for (unsigned j = 0; j < 26; j++) if (text == sh[j]) { index = (3 * k + 4) % 26; //a=3 b=4 result += sh[index]; k = 0; break; } else k++; } void deCode() { for (unsigned i = 0; i < text.length(); i++) for (unsigned j = 0; j < 26; j++) if (text == sh[j]) { index = (9 * (k - 4)) % 26; //a=3 b=4 result += sh[index]; k = 0; break; } else k++; } }
rustam777 R rustam777 Регистрация 14 Июл 2013 Сообщения 70 Репутация 0 Спасибо 0 Монет 0 9 Ноя 2016 #2 retutn`а нет и скобки после main`а. Позитивный голос 0
Ворон В Ворон Регистрация 1 Июл 2013 Сообщения 70 Репутация 0 Спасибо 0 Монет 0 9 Ноя 2016 #3 ты не закрыл main Позитивный голос 0