2021-11-30 16:15:25 +01:00
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace Solution
|
|
|
|
{
|
|
|
|
class Program
|
|
|
|
{
|
|
|
|
static void Main()
|
|
|
|
{
|
|
|
|
string line = Console.ReadLine();
|
|
|
|
string result = "";
|
|
|
|
for (int index = 0; index < line.Length; index++)
|
|
|
|
{
|
|
|
|
int numberOfAppearances = 0;
|
|
|
|
char valueToSearch = line[index];
|
|
|
|
int iteration = index;
|
|
|
|
while (iteration < line.Length && line[iteration] == valueToSearch)
|
|
|
|
{
|
|
|
|
numberOfAppearances += 1;
|
|
|
|
iteration++;
|
|
|
|
}
|
2021-11-30 16:42:54 +01:00
|
|
|
result = result + numberOfAppearances.ToString() + valueToSearch;
|
2021-11-30 16:15:25 +01:00
|
|
|
index += numberOfAppearances - 1;
|
|
|
|
}
|
|
|
|
Console.WriteLine(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|