Example #1
0
        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);
            }
        }
Example #2
0
        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);
            }
        }
Example #3
0
        public static long NextLong()
        {
            string token = Cin.NextToken();

            return(long.Parse(token));
        }
Example #4
0
        public static int NextInt()
        {
            string token = Cin.NextToken();

            return(int.Parse(token));
        }