Exemplo n.º 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);
            }
        }
Exemplo n.º 2
0
        static void Main(String[] args)
        {
            r = Cin.NextInt();
            c = Cin.NextInt();
            int n = Cin.NextInt();

            int[,] board = new int[r, c];
            for (int i = 0; i < r; i++)
            {
                var line = Cin.NextToken();
                for (int j = 0; j < c; j++)
                {
                    if (line[j] == '.')
                    {
                        board[i, j] = 0;
                    }
                    else
                    {
                        board[i, j] = 4;
                    }
                }
            }

            int[,,] buffer = new int[r, c, 2];
            for (int i = 0; i < r; i++)
            {
                for (int j = 0; j < c; j++)
                {
                    buffer[i, j, 0] = board[i, j];
                }
            }


            n = (n - 2) % 4 + 2;
            int p = tick(buffer, 0, n);

            for (int i = 0; i < r; i++)
            {
                for (int j = 0; j < c; j++)
                {
                    Cout.Write(buffer[i, j, p] == 0? '.': 'O');
                }
                Cout.Print("");
            }
        }
Exemplo n.º 3
0
        public static long NextLong()
        {
            string token = Cin.NextToken();

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

            return(int.Parse(token));
        }