Last active
August 29, 2015 14:28
-
-
Save zinark/cd332b648f2cb01e5899 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| static class IO | |
| { | |
| public static int ReadInt () | |
| { | |
| var n = Console.ReadLine (); | |
| return int.Parse (n); | |
| } | |
| public static List<int> ReadInts (char s = ' ') | |
| { | |
| var n = Console.ReadLine (); | |
| var ns = n.Split (s); | |
| var result = new List<int> (); | |
| foreach (var i in ns) | |
| { | |
| result.Add (int.Parse (i)); | |
| } | |
| return result; | |
| } | |
| public static void Print<T> (IEnumerable<T> list, char s = ' ') | |
| { | |
| foreach (var l in list) { Console.Write (l); Console.Write (s); } | |
| } | |
| public static void Print (decimal d) | |
| { | |
| Console.WriteLine ("{0:F3}", d); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment