| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 73981 | 梁敖铭 | 情报加密 | C++ | Wrong Answer | 1 MS | 276 KB | 775 | 2024-05-20 21:24:00 |
#include <iostream> #include <string> using namespace std; string encrypt(string plaintext) { string encryptedText = ""; for (int i = 0; i < plaintext.length(); i++) { char c = plaintext[i]; if (isalpha(c)) { c = (c - 'a' + 23) % 26 + 'a'; } encryptedText += c; } int left = 0, right = encryptedText.length() - 1; while (left < right) { swap(encryptedText[left], encryptedText[right]); left++; right--; } return encryptedText; } int main() { string plaintext; getline(cin, plaintext); string ciphertext = encrypt(plaintext); cout<< ciphertext << endl; return 0; }
------Input------
It is my pleasure.
------Answer-----
Ju jt nz qmfbtvsf.
------Your output-----
.borpxbim vj pf q`