class Program
{
static void Main(string[] args)
{
Console.WriteLine(LetterChanges(Console.ReadLine()));
Console.ReadLine();
}
public static string LetterChanges(string str)
{
string newString = "";
char[] chr = str.ToCharArray();
for (int i = 0; i < chr.Length; i++)
{
var chr1 = chr[i];
bool result = chr1.ToString().All(x => char.IsLetter(x));
if(result)
{
char chr2 = (char)((int)chr1 + 1);
newString += chr2;
}
else
{
char chr2 = (char)((int)chr1);
newString += chr2;
}
}
return newString;
}
}
Output
No comments:
Post a Comment