desislava777

Number 0...9 to Text

Oct 21st, 2017
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 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 ConsoleApplication1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var num = int.Parse(Console.ReadLine());
  14. if (num == 1)
  15. {
  16. Console.WriteLine("one");
  17. }
  18. else if (num == 2)
  19. {
  20. Console.WriteLine("two");
  21. }
  22. else if (num == 3)
  23. {
  24. Console.WriteLine("three");
  25. }
  26. else if (num == 4)
  27. {
  28. Console.WriteLine("four");
  29. }
  30. else if (num == 5)
  31. {
  32. Console.WriteLine("five");
  33. }
  34. else if (num == 6)
  35. {
  36. Console.WriteLine("six");
  37. }
  38. else if (num == 7)
  39. {
  40. Console.WriteLine("seven");
  41. }
  42. else if (num == 8)
  43. {
  44. Console.WriteLine("eight");
  45. }
  46. else if (num == 9)
  47. {
  48. Console.WriteLine("nine");
  49. }
  50. else
  51. {
  52. Console.WriteLine("number too big");
  53. }
  54.  
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment