using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; namespace AtCoder { class Program { static void Main() { } delegate T Version2(T arg); // C# 2 Generics void Version3() { Version2 f = n => n; } // C# 3 Lambda interface IVersion4 { } // C# 4 covariance async void Version5() { } // C# 5 async/await string Version6() { return nameof(Version6); } // C# 6 nameof bool Version7() { return int.TryParse("3", out _); } // C# 7 discard (int a, int b) Version7_ValueTupe() { return (1, 2); } // C# 7 ValueTuple bool Version7_1() { return default; } // C# 7.1 default int Version7_2() { return 0x_1; } // C# 7.2 leading digit separator void Version7_3() where T : unmanaged { } // C# 7.3 unmanaged generics BigInteger SystemNumerics(BigInteger a, BigInteger b) { return a + b; } // System.Numerics.BigInteger int Version8() { return true switch { true => 1, false => 0 }; } // C# 8 switch expression Span Span(int[] array) { return array.AsSpan(); } // System.Span object Version9() { return new(); } // C# 9 target-typed new } }