public static decimal NextDecimal(bool acceptAnyDecimalSeparator = true) { string token = Cin.NextToken(); if (acceptAnyDecimalSeparator) { token = token.Replace(',', '.'); decimal result = decimal.Parse(token, CultureInfo.InvariantCulture); return(result); } else { decimal result = decimal.Parse(token); return(result); } }
public static double NextDouble(bool acceptAnyDecimalSeparator = true) { var token = Cin.NextToken(); if (acceptAnyDecimalSeparator) { token = token.Replace(',', '.'); var result = double.Parse(token, CultureInfo.InvariantCulture); return(result); } else { var result = double.Parse(token); return(result); } }
public static long NextLong() { string token = Cin.NextToken(); return(long.Parse(token)); }
public static int NextInt() { string token = Cin.NextToken(); return(int.Parse(token)); }