C# 알고리즘 코딩(프로그래머스)
프로그래머스 C# 홀짝
라이프앤타임
2023. 7. 15. 02:07
using System;
public class Example
{
public static void Main()
{
String[] s;
Console.Clear();
s = Console.ReadLine().Split(' ');
int a = Int32.Parse(s[0]);
if(a%2 == 0)
{
Console.WriteLine(a + " is even");
}
else
{
Console.WriteLine(a + " is odd");
}
}
}
/// 홀수면 odd, 짝수면 even이 출력되도록 한다.