백준

백준 27866번 c#

대왕군 2024. 1. 10. 15:22

 

using System;

namespace Baekjoon
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int index = int.Parse(Console.ReadLine());
            //문장변수.Substring(시작할 위치, 자를 문장의 길이)
            //0이 시작위치이며 단어 하나만 받아오면 되니 두번째 인자는 1로 해줌
            Console.WriteLine(input.Substring(index - 1, 1));
        }
    }
}

'백준' 카테고리의 다른 글

백준 9086번 c#  (0) 2024.01.10
백준 15552번 c#  (0) 2024.01.10
백준 10811번 c#  (0) 2024.01.10
백준 3052번 c#  (0) 2024.01.10
백준 2743번 c#  (0) 2024.01.10