using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
public static string ReverseString(string input)
{
string output = null;
if (input != null)
{
for (int i = 0; i < input.Length; i++)
{
output = input[i] + output;
}
}
return output;
}
public static string ReverseWord(string input)
{
string output = null;
if (input != null)
{
string[] words = input.Split(' ');
foreach (string word in words)
{
output = output + ReverseString(word) + " ";
}
output = output.TrimEnd(' ');
}
return output;
}
static void Main(string[] args)
{
string a = null;
Console.WriteLine(ReverseString(a));
Console.WriteLine(ReverseWord(a));
a = string.Empty;
Console.WriteLine(ReverseString(a));
Console.WriteLine(ReverseWord(a));
a = "asfddsaf123_*(*%^$afd";
Console.WriteLine(ReverseString(a));
Console.WriteLine(ReverseWord(a));
a = "Welcome to my blog!";
Console.WriteLine(ReverseString(a));
Console.WriteLine(ReverseWord(a));
}
}
}