250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- button
- 비전공 개발자
- HTML
- xcode
- iPhone
- 풀스택
- hover
- 프론트엔드
- html5
- MAC
- react
- php
- effect
- css3
- jQuery
- ipad
- CSS
- image
- 자바스크립트
- javascript
- front-end
- keyframes
- iOS 개발자
- 비전공자
- 개발자
- 백엔드
- SWIFT
- Animation
- IOS
- 애니메이션
Archives
- Today
- Total
비전공자 개발일기
[SWIFT] Coding Test Practice Day 1 본문
728x90
SMALL
https://school.programmers.co.kr/
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
두수의 합
import UIKit
func solution(_ num1:Int, _ num2:Int) -> Int {
guard (num1 >= -50000 && num1 <= 50000), (num2 >= -50000 && num2 <= 50000) else {
return -110000
}
let res = num1 + num2
return res
}
solution(2, 3)
solution(100, 2)
두수의 차
import UIKit
func solution(_ num1:Int, _ num2:Int) -> Int {
guard (num1 >= -50000 && num1 <= 50000), (num2 >= -50000 && num2 <= 50000) else {
return -110000
}
let res = num1 - num2
return res
}
solution(2, 3)
solution(100, 2)
두수의 곱
func solution(_ num1:Int, _ num2:Int) -> Int {
guard (num1 >= 0 && num1 <= 100), (num2 >= 0 && num2 <= 100) else {
return -1
}
let res = num1 * num2
return res
}
solution(3, 4)
solution(27, 19)
몫 구하기
func solution(_ num1:Int, _ num2:Int) -> Int {
guard (num1 >= 0 && num1 <= 100), (num2 >= 0 && num2 <= 100) else {
return -1
}
let res = num1 / num2
return res
}
solution(10, 5)
solution(7, 2)
728x90
LIST
'SWIFT' 카테고리의 다른 글
[SWIFT] Coding Test Practice Day 3 (0) | 2022.11.09 |
---|---|
[SWIFT] Coding Test Practice Day 2 (0) | 2022.11.08 |
UP and Down Number Game in iOS APP (0) | 2022.11.05 |
UP and DOWN Number Game (0) | 2022.11.05 |
Rock Scissors Paper (0) | 2022.11.04 |