728x90
https://school.programmers.co.kr/learn/courses/30/lessons/181944
📝 나의 풀이
using System;
public class Example
{
public static void Main()
{
String[] s;
Console.Clear();
s = Console.ReadLine().Split(' ');
int n = Int32.Parse(s[0]);
if(n%2==0){
Console.Write (n+" is even");
} else {
Console.Write (n+" is odd");
}
}
}
728x90
'코딩테스트 > [C#] 프로그래머스' 카테고리의 다른 글
[프로그래머스 | C# | Lv.0] 글자 이어 붙여 문자열 만들기 (0) | 2023.09.05 |
---|---|
[프로그래머스 | C# | Lv.0] 더 크게 합치기 (0) | 2023.09.04 |
[프로그래머스 | C# | Lv.0] 홀짝에 따라 다른 값 반환하기 (0) | 2023.09.04 |
[프로그래머스 | C# | Lv.0] 배열의 길이에 따라 다른 연산하기 (0) | 2023.09.04 |
[프로그래머스 | C# | Lv.0] 홀수 vs 짝수 (0) | 2023.09.04 |