Skip to content

Instantly share code, notes, and snippets.

@zinark
Last active August 29, 2015 14:28
Show Gist options
  • Select an option

  • Save zinark/cd332b648f2cb01e5899 to your computer and use it in GitHub Desktop.

Select an option

Save zinark/cd332b648f2cb01e5899 to your computer and use it in GitHub Desktop.
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