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 ConsoleApplication7
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- Console.WriteLine(ReturnDigit(n));
- }
- private static string ReturnDigit(int number)
- {
- string[] digits = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
- int lastDigit = number % 10;
- for (int i = 0; i < digits.Length; i++)
- {
- if (lastDigit == i)
- {
- return digits[i];
- }
- }
- return null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment