frxbg

EnglishNameOfLastDigit

May 30th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace EnglishNameOfLastDigit
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string[] digitNames = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
  11.            
  12.             string input = Console.ReadLine();
  13.             int lastDigit = int.Parse(input[input.Length - 1].ToString());
  14.             Console.WriteLine(digitNames[lastDigit]);
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment