using System.Collections.Generic;
public static void Main(string[] args)
var totalPlaces = args != null && args.Length > 0 ? int.Parse(args[0]) : 200;
var dogPlace = args != null && args.Length > 1 ? int.Parse(args[1]) : 3;
Console.WriteLine(string.Join(", ", GetPlaces(totalPlaces, dogPlace)));
public static IEnumerable<string> GetPlaces(int maxPlace, int dogPlace)
string[] suffixes = new string[]{"th", "st", "nd", "rd"};
from place in Enumerable.Range(1, maxPlace)
let lastTwoDigits = place % 100
let isUniqueCase = (11 <= lastTwoDigits && lastTwoDigits <= 13)
let lastDigit = place % 10
let alwaysHasThSuffix = suffixes.Length <= lastDigit
let suffixIndex = isUniqueCase | alwaysHasThSuffix ? 0 : lastDigit
select place + suffixes[suffixIndex];