Помогнете 3-116. Number 0...100 to Text Къде бъркам?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ONetoTen
{
class Program
{
static void Main(string[] args)
{
int num = int.Parse(Console.ReadLine());
if (num == 0)
Console.WriteLine("zero");
else if (num == 1)
Console.WriteLine("one");
else if (num == 2)
Console.WriteLine("two");
else if (num == 3)
Console.WriteLine("three");
else if (num == 4)
Console.WriteLine("four");
else if (num == 5)
Console.WriteLine("five");
else if (num == 6)
Console.WriteLine("six");
else if (num == 7)
Console.WriteLine("seven");
else if (num == 8)
Console.WriteLine("eight");
else if (num == 9)
Console.WriteLine("nine");
else if (num == 10)
Console.WriteLine("ten");
else if (num == 11)
Console.WriteLine("eleven");
else if (num == 12)
Console.WriteLine("twelve");
else if (num == 13)
Console.WriteLine("thirteen");
else if (num == 14)
Console.WriteLine("fourteen");
else if (num == 15)
Console.WriteLine("fiveteen");
else if (num == 16)
Console.WriteLine("sixteen");
else if (num == 17)
Console.WriteLine("seventeen");
else if (num == 18)
Console.WriteLine("eighteen");
else if (num == 19)
Console.WriteLine("nineteen");
else if (num == 20)
Console.WriteLine("twenty");
else if (num == 21)
Console.WriteLine("twenty one");
else if (num == 22)
Console.WriteLine("twenty two");
else if (num == 23)
Console.WriteLine("twenty three");
else if (num == 24)
Console.WriteLine("twenty four");
else if (num == 25)
Console.WriteLine("twenty five");
else if (num == 26)
Console.WriteLine("twenty six");
else if (num == 27)
Console.WriteLine("twenty seven");
else if (num == 28)
Console.WriteLine("twenty eight");
else if (num == 29)
Console.WriteLine("twenty nine");
else if (num == 30)
Console.WriteLine("thirty");
else if (num == 31)
Console.WriteLine("thirty one");
else if (num == 32)
Console.WriteLine("thirty two");
else if (num == 33)
Console.WriteLine("thirty three");
else if (num == 34)
Console.WriteLine("thirty four");
else if (num == 35)
Console.WriteLine("thirty five");
else if (num == 36)
Console.WriteLine("thirty six");
else if (num == 37)
Console.WriteLine("thirty seven");
else if (num == 38)
Console.WriteLine("thirty eight");
else if (num == 39)
Console.WriteLine("thirty nine");
else if (num == 40)
Console.WriteLine("forty");
else if (num == 41)
Console.WriteLine("forty one");
else if (num == 42)
Console.WriteLine("forty two");
else if (num == 43)
Console.WriteLine("forty three");
else if (num == 44)
Console.WriteLine("forty four");
else if (num == 45)
Console.WriteLine("forty five");
else if (num == 46)
Console.WriteLine("forty six");
else if (num == 47)
Console.WriteLine("forty seven");
else if (num == 48)
Console.WriteLine("forty eight");
else if (num == 49)
Console.WriteLine("forty nine");
else if (num == 50)
Console.WriteLine("fifty");
else if (num == 51)
Console.WriteLine("fifty one");
else if (num == 52)
Console.WriteLine("fifty two");
else if (num == 53)
Console.WriteLine("fifty three");
else if (num == 54)
Console.WriteLine("fifty four");
else if (num == 55)
Console.WriteLine("fifty five");
else if (num == 56)
Console.WriteLine("fifty six");
else if (num == 57)
Console.WriteLine("fifty seven");
else if (num == 58)
Console.WriteLine("fifty eight");
else if (num == 59)
Console.WriteLine("fifty nine");
else if (num == 60)
Console.WriteLine("sixty");
else if (num == 61)
Console.WriteLine("sixty one");
else if (num == 62)
Console.WriteLine("sixty two");
else if (num == 63)
Console.WriteLine("sixty three");
else if (num == 64)
Console.WriteLine("sixty four");
else if (num == 65)
Console.WriteLine("sixty five");
else if (num == 66)
Console.WriteLine("sixty six");
else if (num == 67)
Console.WriteLine("sixty seven");
else if (num == 68)
Console.WriteLine("sixty eight");
else if (num == 69)
Console.WriteLine("sixty nine");
else if (num == 70)
Console.WriteLine("seventy");
else if (num == 71)
Console.WriteLine("seventy one");
else if (num == 72)
Console.WriteLine("seventy two");
else if (num == 73)
Console.WriteLine("seventy three");
else if (num == 74)
Console.WriteLine("seventy four");
else if (num == 75)
Console.WriteLine("seventy five");
else if (num == 76)
Console.WriteLine("seventy six");
else if (num == 77)
Console.WriteLine("seventy seven");
else if (num == 78)
Console.WriteLine("seventy eight");
else if (num == 79)
Console.WriteLine("seventy nine");
else if (num == 80)
Console.WriteLine("eighty");
else if (num == 81)
Console.WriteLine("eighty one");
else if (num == 82)
Console.WriteLine("eighty two");
else if (num == 83)
Console.WriteLine("eighty three");
else if (num == 84)
Console.WriteLine("eighty four");
else if (num == 85)
Console.WriteLine("eighty five");
else if (num == 86)
Console.WriteLine("eighty six");
else if (num == 87)
Console.WriteLine("eighty seven");
else if (num == 88)
Console.WriteLine("eighty eight");
else if (num == 89)
Console.WriteLine("eighty nine");
else if (num == 90)
Console.WriteLine("ninety");
else if (num == 91)
Console.WriteLine("ninety one");
else if (num == 92)
Console.WriteLine("ninety two");
else if (num == 93)
Console.WriteLine("ninety three");
else if (num == 94)
Console.WriteLine("ninety four");
else if (num == 95)
Console.WriteLine("ninety five");
else if (num == 96)
Console.WriteLine("ninety six");
else if (num == 97)
Console.WriteLine("ninety seven");
else if (num == 98)
Console.WriteLine("ninety eight");
else if (num == 99)
Console.WriteLine("ninety nine");
else if (num == 100)
Console.WriteLine("hundred");
else
Console.WriteLine("number too Big");
}
}
}
Задача: * изписване на число от 0 до 100 с думи
Да се напише програма, която превръща число в диапазона [0 … 100] в текст.
Примерен вход и изход
Вход
Изход
25
twenty five
42
forty two
6
six
Насоки и подсказки
Проверете първо за едноцифрени числа и ако числото е едноцифрено, отпечатайте съответната дума за него. След това проверете за двуцифрени числа. Тях отпечатвайте на две части: лява част (десетици = числото / 10) и дясна част (единици = числото % 10). Ако числото има 3 цифри, трябва да е 100 и може да се разгледа като специален случай