static void Main(string[] args)
{
string s=Console.ReadLine();
char[] d = new char[12] {' ', '!', '(', ')', ':', ';', ',','.','?', '"', '\'', '-'};
string[] words = s.Split(d);
int j = 0;
if (words.Length > 0)
{
string[] ret = new string[words.Length];
Console.WriteLine("\nTask 1)");
for (int i = 0; i < words.Length; i++)
{
if (words[i].Length > 1)
{
//1)
if (IsLatin(words[i][0]) && IsLatin(words[i][1]))
{
ret[j] = words[i];
Console.WriteLine(ret[j++]);
}
//2)
for (int k = 0; k < words.Length; k++)
{
words[i] = UChar(words[i]);
}
}
}
Console.WriteLine("\nTask 2)");
for (int i = 0; i < words.Length; i++)
{
Console.WriteLine(words[i]);
}
}
//Console.WriteLine(s);
Console.ReadKey();
}
private static bool IsLatin(char c)
{
return (c.ToString().ToLower().CompareTo("a") >= 0
&& c.ToString().ToLower().CompareTo("z") <= 0);
}
private static string UChar(string s)
{
string ret = "";
int j = 0;
for (int i = 0; i < s.Length; i++)
{
for (j=0; j<ret.Length; j++)
{
if (ret[j] == s[i]) break;
}
if (j == ret.Length) ret += s[i];
}
return ret;
}