HIT해

[프로그래머스] 대소문자 바꿔서 출력하기 본문

Swift/Swift 알고리즘

[프로그래머스] 대소문자 바꿔서 출력하기

힛해 2024. 8. 31. 00:26
728x90

https://school.programmers.co.kr/learn/courses/30/lessons/181949

 

프로그래머스

코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.

programmers.co.kr

 

 

import Foundation

let s1 = readLine()!

for i in s1{
    if i.isLowercase{
        print(i.uppercased(), terminator: "")
    }else{
        print(i.lowercased(), terminator: "")
    }
}