https://www.acmicpc.net/problem/11655
#include <iostream>
#include <string>
using namespace std;
string s{};
string Result{};
int main()
{
getline(cin, s);
for (int i = 0; i < s.size(); i++)
{
int temp = 13;
if(s[i] >= 'a' && s[i] <='z')
{
if (s[i] + temp > 'z')
{
temp = (s[i] + 13) - 'z' - 1;
s[i] = temp + 'a';
}
else
s[i] += temp;
}
else if (s[i] >= 'A' && s[i] <= 'Z')
{
if (s[i] + temp > 'Z')
{
temp = (s[i] + 13) - 'Z' - 1;
s[i] = temp + 'A';
}
else
s[i] += temp;
}
}
cout << s << endl;
}