Jump to content

99 bottles of beer: Difference between revisions

→‎Another Implementation using Linq: Removed extra copy of C# Linq solution
(→‎{{header|Go}}: task conformance + lang tag)
(→‎Another Implementation using Linq: Removed extra copy of C# Linq solution)
Line 851:
Console.WriteLine(item);
}
}
}</lang>
 
<lang csharp>using System;
using System.Linq;
 
class Program
{
static void Main()
{
Enumerable.Range(0,100)
.Reverse()
.Select(total => total > 0
? string.Format("{0} bottles of beer on the wall\n{0} bottles of beer\nTake one down, pass it around", total)
: string.Format("{0} bottles left", total))
.ToList()
.ForEach(s => Console.WriteLine(s));
}
}</lang>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.