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 _03.englishNameOfLastDigit
- {
- class Program
- {
- static void Main(string[] args)
- {
- var number = long.Parse(Console.ReadLine());
- string name = number.ToString();
- string result = name[name.Length - 1].ToString();
- string whatToPrint = ReturnNames(result);
- Console.WriteLine(whatToPrint);
- }
- public static string ReturnNames(string number)
- {
- string itsName = "";
- if (string.Equals(number, "1") || string.Equals(number, "-1"))
- {
- itsName = "one";
- }
- else if (string.Equals(number, "2") || string.Equals(number, "-2"))
- {
- itsName = "two";
- }
- else if (string.Equals(number, "3") || string.Equals(number, "-3"))
- {
- itsName = "three";
- }
- else if (string.Equals(number, "4") || string.Equals(number, "-4"))
- {
- itsName = "four";
- }
- else if (string.Equals(number, "5") || string.Equals(number, "-5"))
- {
- itsName = "five";
- }
- else if (string.Equals(number, "6") || string.Equals(number, "-6"))
- {
- itsName = "six";
- }
- else if (string.Equals(number, "7") || string.Equals(number, "-7"))
- {
- itsName = "seven";
- }
- else if (string.Equals(number, "8") || string.Equals(number, "-8"))
- {
- itsName = "eight";
- }
- else if (string.Equals(number, "9") || string.Equals(number, "-9"))
- {
- itsName = "nine";
- }
- else if (string.Equals(number, "0"))
- {
- itsName = "null";
- }
- else
- {
- itsName = "wrong";
- }
- return itsName;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement