반응형
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Source
{
class Program
{
static void Main(string[] args)
{
Console.Write("숫자 입력 : ");
string inputnum = Console.ReadLine();
int num = int.Parse(inputnum);
int evennumber = num % 2;
int oddnumber = num % 2 + 1;
string result = (evennumber == 0 && oddnumber == 1) ? "짝수" : "홀수";
Console.WriteLine(result);
}
}
}
반응형