Advertisement
Guest User

Untitled

a guest
May 7th, 2015
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 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 LastDigit_2
  8. {
  9.     class LastDigit_2
  10.     {
  11.         static string[] number = { "zero", "one", "two", "three", "four", "five",
  12.                               "six", "seven", "eight", "nine"};
  13.  
  14.         static void PrintNumber(int num)
  15.         {
  16.             int lastDigit = num % 10;
  17.             Console.WriteLine(number[lastDigit]);
  18.         }
  19.         static void Main(string[] args)
  20.         {
  21.             int a = int.Parse(Console.ReadLine());
  22.  
  23.             PrintNumber(a);
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement