NedyalkoKikov

EnglishNameOFTheLAstDigits

May 26th, 2016
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace EnglishNameOfTheLastDigits
  8. {
  9. class EnglishNameOFTheLAstDigits
  10. {
  11. static void Main()
  12. {
  13. EnglishName();
  14. }
  15. public static void EnglishName()
  16. {
  17. long num = long.Parse(Console.ReadLine());
  18. int digit = (int)Math.Abs(num % 10);
  19. Dictionary<int, string> lastNumber = new Dictionary<int, string>
  20. {
  21. [1] = "one",
  22. [2] = "two",
  23. [3] = "three",
  24. [4] = "four",
  25. [5] = "five",
  26. [6] = "six",
  27. [7] = "seven",
  28. [8] = "eight",
  29. [9] = "nine",
  30. [0] = "zero"
  31. };
  32. Console.WriteLine(lastNumber[digit]);
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment