Advertisement
tochka

English Name

Oct 3rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 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 _03.English_Name_of_the_Last_Digit
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int name = int.Parse(Console.ReadLine());
  14. int lastDigit = EnglishName(name);
  15. }
  16.  
  17. static int EnglishName(int name)
  18. {
  19. int lastDigit = name % 10;
  20. if (lastDigit == 1)
  21. {
  22. Console.WriteLine("one");
  23. }
  24. else if (lastDigit == 2)
  25. {
  26. Console.WriteLine("two");
  27. }
  28. else if (lastDigit == 3)
  29. {
  30. Console.WriteLine("three");
  31. }
  32. else if (lastDigit == 4)
  33. {
  34. Console.WriteLine("four");
  35. }
  36. else if (lastDigit == 5)
  37. {
  38. Console.WriteLine("five");
  39. }
  40. else if (lastDigit == 6)
  41. {
  42. Console.WriteLine("six");
  43. }
  44. else if (lastDigit == 7)
  45. {
  46. Console.WriteLine("seven");
  47. }
  48. else if (lastDigit == 8)
  49. {
  50. Console.WriteLine("eight");
  51. }
  52. else if (lastDigit == 9)
  53. {
  54. Console.WriteLine("nine");
  55. }
  56. else
  57. {
  58. Console.WriteLine("zero");
  59. }
  60. return name;
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement