Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Arrays_and_Methods___Exercise
- {
- class Program
- {
- static void Main(string[] args)
- {
- string number = Console.ReadLine();
- int indexN = int.Parse(Console.ReadLine());
- Console.WriteLine(FindTheNthDigit(number, indexN));
- }
- public static char FindTheNthDigit(string numberForResearch, int index)
- {
- int returnIndex = numberForResearch.Length - index;
- char result = numberForResearch[returnIndex];
- return (char) result;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement