var input = Console.ReadLine().Split(' ');
var output = new List<string>();
foreach (var word in input)
{
if (word.Length <= 4)
{
output.Add(word);
continue;
}
// word reversal. This can be done using inbuilt functions as well
var wordArray = word.ToCharArray();
var current = string.Empty;
for (int i = word.Length - 1; i >= 0 ; i--)
{
current += wordArray[i];
}
output.Add(current);
}
Console.WriteLine(string.Join(" ", output));
Console.ReadKey();
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.
A quick one in C#