Created
April 29, 2015 16:22
-
-
Save andrebires/4e003868a6d56889511f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Enter the number of iteractions: "); | |
int count; | |
if (!int.TryParse(Console.ReadLine(), out count)) count = 10; | |
var value = "x"; | |
while (count-- > 0) | |
{ | |
Console.WriteLine(value); | |
value = value | |
.GroupBy(c => c) | |
.Select(v => string.Format("{0}{1}", v.Count(), v.Key)) | |
.Aggregate((v1, v2) => string.Format("{0}{1}",v1,v2)); | |
} | |
Console.WriteLine("Press any key to end"); | |
Console.ReadLine(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment