Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
460 B
0
Indexable
Never
#include <iostream>
#include <string>
using namespace std;
int main()
{
	string str; int i;
    getline(cin, str);
	for (i = 0; i < str.length(); i++)
	{
		if (str[i] != ' ') {
			if (str[i] >= 'A' && str[i] <= 'Z') {
				str[i] += 2;
				if (str[i] > 'Z') str[i] = str[i] - 'Z' - 1 + 'A';
			}
			if (str[i] >= 'a' && str[i] <= 'z') {
				str[i] += 2;
				if (str[i] > 'z') str[i] = str[i] - 'z' - 1 + 'a';
			}
		}
	}
	cout << str;
}