#include <iostream>
intmain(){unsignedkey=1;std::stringtoEncrypt="defend the east wall of the castle";if(key<1||key>26){std::cout<<"Key must be in range of 1-26"<<std::endl;return0;}for(char&c:toEncrypt){if(c<'A'||c>'z'){continue;}elseif(c+key>'z'){c='a'+(c+key)%122-1;continue;}elseif(c+key>'Z'&&c<'a'){c='A'+(c+key)%90-1;continue;}c+=key;}std::cout<<toEncrypt;return0;}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
C++