static void enter(out char[] chars) {// создаем символьный массив Console.WriteLine("введите предложение"); string str = Console.ReadLine(); chars = str.ToCharArray(); } static void process(ref char[] chars) { //создаем разделитель char[] delimiterChars = { ' ', ',', '.', ':', '\t' }; for (int i = 0; i < chars.Length; i++) {//добавляем абзац между словами int l = 0; for (int j = 0; j < delimiterChars.Length; j++) { if (chars[i] == delimiterChars[j]) l++; } if (l > 0) chars[i] = '!'; } } static void output(ref char[] chars) { //выводим массив на экран foreach (char ch in chars) Console.Write(ch); } static void Main(string[] args) { Char[] chars; enter(out chars); process(ref chars); Console.WriteLine("Result:"); output(ref chars); Console.ReadKey(); }