Skip to content

Commit

Permalink
Create procedural.cs (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
pikoslav authored Apr 18, 2024
1 parent c6702d0 commit ceef7b3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/cs/piki/procedural.cs
Original file line number Diff line number Diff line change
@@ -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());

0 comments on commit ceef7b3

Please sign in to comment.