본문 바로가기 메뉴 바로가기

강경하다

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

강경하다

검색하기 폼
  • 분류 전체보기 (141)
    • iOS (27)
    • Swift (39)
    • Swift Playground (14)
    • Design Pattern (5)
    • TDD (3)
    • CleanCode (2)
    • Algorithm (40)
    • Git (5)
    • CS Basic (4)
    • SoOn (0)
    • Review (2)
  • 방명록

Algorithm (40)
swift 백준 1110

let inputNum: String = readLine()! let firstNum: Int = Int(inputNum)! var nextNum: Int = firstNum var count: Int = 0 while true { let num1 = nextNum / 10 let num2 = nextNum % 10 let sumNum = num1 + num2 nextNum = (num2 * 10) + (sumNum % 10) count += 1 if nextNum == firstNum { print(count) break } } 더하기 사이클의 규칙만 이해하면 쉽게 풀 수 있다. www.acmicpc.net/problem/1110 1110번: 더하기 사이클 0보다 크거나 같고, 99보다 작거나 같은 정..

Algorithm 2020. 12. 28. 09:04
swift 백준 10951

while let inputString = readLine() { let inputArr = inputString.split(separator: " ").map{ Int($0)! } print(inputArr[0] + inputArr[1]) } while조건에 입력형태로 넣어주는 곳에서 틀렸다. ... 여러번 해서 익숙해지자! www.acmicpc.net/problem/10951 10951번: A+B - 4 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. www.acmicpc.net

Algorithm 2020. 12. 28. 08:59
swift 백준 10952

while true { let inputArr = readLine()!.split(separator: " ").map{ Int($0)! } if inputArr[0] == 0 && inputArr[1] == 0 { break } print(inputArr[0] + inputArr[1]) } 무한루프 중에 break조건을 넣어주면 된다. www.acmicpc.net/problem/10952 10952번: A+B - 5 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. www.acmicpc.net

Algorithm 2020. 12. 28. 08:55
이전 1 2 3 4 5 6 7 ··· 14 다음
이전 다음
250x250
TAG
  • IF문
  • 입출력과 사칙연산
  • Method
  • Playground
  • 테스트주도개발
  • GIT
  • structure
  • 코딩배우기1
  • swift playground
  • function
  • CLASS
  • algorithm
  • IOS
  • protocol
  • loop
  • Design Pattern
  • 코딩배우기2
  • flow control
  • Network
  • URLSession
  • tdd
  • for문
  • xcode
  • Swift
  • basic
  • closure
  • while문
  • 백준
  • 1차원 배열
  • 미완성
more
최근에 올라온 글
링크
  • Gmail
  • Instagram
  • Github
Total
Today
Yesterday

Blog is powered by Tistory / Designed by Tistory

티스토리툴바