Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Practice
- {
- class Practice
- {
- static void Main()
- {
- int num = int.Parse(Console.ReadLine());
- string word = LastDigit(num);
- Console.WriteLine(word);
- }
- static string LastDigit(int n)
- {
- int tmp = n % 10;
- switch (tmp)
- {
- case 1: return "one";
- case 2: return "two";
- case 3: return "three";
- case 4: return "four";
- case 5: return "five";
- case 6: return "six";
- case 7: return "seven";
- case 8: return "eight";
- case 9: return "nine";
- default:
- return "zero";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment