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.English_Name_of_the_Last_Digit
- {
- class Program
- {
- static void Main(string[] args)
- {
- int name = int.Parse(Console.ReadLine());
- int lastDigit = EnglishName(name);
- }
- static int EnglishName(int name)
- {
- int lastDigit = name % 10;
- if (lastDigit == 1)
- {
- Console.WriteLine("one");
- }
- else if (lastDigit == 2)
- {
- Console.WriteLine("two");
- }
- else if (lastDigit == 3)
- {
- Console.WriteLine("three");
- }
- else if (lastDigit == 4)
- {
- Console.WriteLine("four");
- }
- else if (lastDigit == 5)
- {
- Console.WriteLine("five");
- }
- else if (lastDigit == 6)
- {
- Console.WriteLine("six");
- }
- else if (lastDigit == 7)
- {
- Console.WriteLine("seven");
- }
- else if (lastDigit == 8)
- {
- Console.WriteLine("eight");
- }
- else if (lastDigit == 9)
- {
- Console.WriteLine("nine");
- }
- else
- {
- Console.WriteLine("zero");
- }
- return name;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement