using System; using System.Collections.Generic; namespace Solution { class Program { static void Main() { string line = Console.ReadLine(); Console.WriteLine(GetAcronym(line)); } /// /// Returns the acronym of the given string. /// /// The string to get the acronym of. /// The acronym of the given string. public static string GetAcronym(string line) { line = ReplaceString(line, "\"", ""); string[] words = SplitString(line, " "); string acronym = ""; foreach (string word in words) { acronym += word[0].ToString().ToUpper(); } return acronym; } /// /// Splits a string into words. /// /// The string to split. /// The delimiter to split the string by. /// An array of words. public static string[] SplitString(string source, string delimiter) { List result = new List(); string current = ""; for (int index = 0; index < source.Length; index++) { string character = source[index].ToString(); if (character == delimiter) { result.Add(current); current = ""; } else { current += character; } } result.Add(current); return result.ToArray(); } /// /// Replaces all instances of a string with another string. /// /// The source string. /// The string to replace. /// The string to replace with. /// The new string. public static string ReplaceString(string source, string oldValue, string newValue) { string result = ""; for (int index = 0; index < source.Length; index++) { if (source[index].ToString() == oldValue) { result += newValue; } else { result += source[index]; } } return result; } } }