Например:
Код: Выделить всё
if(i == m) {
Console.WriteLine("Number is valid");
} else {
Console.WriteLine("Number is invalid");
}
Я пытался :
Код: Выделить всё
(i == m) ? Console.WriteLine("Number is valid") : Console.WriteLine("Number is not valid");
Подробнее здесь: https://stackoverflow.com/questions/202 ... -writeline
Мобильная версия