코딩 테스트/Lv.0

대소문자 바꿔서 출력하기

gaon99 2024. 12. 30. 21:11

using System;

public class Example
{
    public static void Main()
    {
        String s;

        Console.Clear();
        s = Console.ReadLine();
        
        for(int i=0;i<s.Length;i++)
        {
            if (Char.IsUpper(s[i]))
            {
                Console.Write(char.ToLower(s[i]));
            }
            else
            {
                Console.Write(char.ToUpper(s[i]));
            }
        }

    }
}

'코딩 테스트 > Lv.0' 카테고리의 다른 글

덧셈식 출력하기  (0) 2024.12.31
특수문자 출력하기  (0) 2024.12.30
문자열 반복해서 출력하기  (1) 2024.12.30
a와 b 출력하기  (1) 2024.12.30
문자열 출력하기  (0) 2024.12.30