Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
otobrglez committed Apr 18, 2024
2 parents aa10576 + ceef7b3 commit 9d6a584
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 9d6a584

Please sign in to comment.