VelizarAvramov

Number 0...9 to Text

Mar 21st, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.45 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 Number_0._._._9_to_Text
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var num = int.Parse(Console.ReadLine());
  14.             if (num == 0)
  15.             {
  16.                 Console.WriteLine("Zero");
  17.             }
  18.             else if (num == 1)
  19.             {
  20.                 Console.WriteLine("One");
  21.             }
  22.             else if (num == 2)
  23.             {
  24.                 Console.WriteLine("Two");
  25.             }
  26.             else if (num == 3)
  27.             {
  28.                 Console.WriteLine("Three");
  29.             }
  30.             else if (num == 4)
  31.             {
  32.                 Console.WriteLine("Four");
  33.             }
  34.             else if (num == 5)
  35.             {
  36.                 Console.WriteLine("Five");
  37.             }
  38.             else if (num == 6)
  39.             {
  40.                 Console.WriteLine("Six");
  41.             }
  42.             else if (num == 7)
  43.             {
  44.                 Console.WriteLine("Seven");
  45.             }
  46.             else if (num == 8)
  47.             {
  48.                 Console.WriteLine("Eight");
  49.             }
  50.             else if (num == 9)
  51.             {
  52.                 Console.WriteLine("Nine");
  53.             }
  54.             else
  55.             {
  56.                 Console.WriteLine("number too big");
  57.            
  58.             }
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment