diff --git a/src/cs/piki/procedural.cs b/src/cs/piki/procedural.cs new file mode 100644 index 0000000..d75c472 --- /dev/null +++ b/src/cs/piki/procedural.cs @@ -0,0 +1,23 @@ +using System; +using System.Text; + + +var s = "AAABBAACC"; +var r = new StringBuilder(); +var c = 1; +var i = 0; +do +{ + if (s[i] == s[i + 1]) + { + c++; + } + else + { + r.Append("" + c + s[i]); + c = 1; + } +} +while (++i < s.Length - 1); + +Console.WriteLine(r.ToString());