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