|
|
back to boardWA 1, Runtime error (access violation), C#. Posted by susimus 29 Jul 2014 13:08 var temp = ""; var cond = false; var list = new List<string>(); while ((temp = Console.ReadLine()) != "") { list.Add(""); foreach (var item in temp) if (char.IsLetter(item)) if (cond == false) { cond = true; list[list.Count() - 1] += char.ToUpper(item); } else list[list.Count() - 1] += char.ToLower(item); else if ((item == 33) || (item == 46) || (item == 63)) { cond = false; list[list.Count() - 1] += item; } else list[list.Count() - 1] += item; } foreach (var item in list) Console.WriteLine(item); Console.Read(); Can anybody help me? |
|
|