μΌ | μ | ν | μ | λͺ© | κΈ | ν |
---|---|---|---|---|---|---|
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
- WebApp
- ios
- λΈλ£¨νΈν¬μ€ μκ³ λ¦¬μ¦
- μ΄μ§νμ
- dp
- λΉνΈμ°μ°μ
- μ½ν
- WebView
- SwiftUI
- λΈλ£¨νΈν¬μ€
- Queue
- νλ‘κ·Έλλ¨Έμ€
- μ ν΄λ¦¬λ νΈμ λ²
- λ¬Έμμ΄
- BFS
- μμ
- λΆν νμ
- λ°±νΈλνΉ
- λ°±μ€
- λΆν μ 볡
- μκ³ λ¦¬μ¦
- λμ ν©
- λΆν μ 볡
- Swift
- μ€ν
- 그리λ μκ³ λ¦¬μ¦
- dfs
- μ½λ©ν μ€νΈ
Archives
- Today
- Total
MUKER_DEV with iOS
[swift] λ°±μ€ - 2577λ²: μ«μμ κ°μ λ³Έλ¬Έ
2577λ²: μ«μμ κ°μ
첫째 μ€μ A, λμ§Έ μ€μ B, μ μ§Έ μ€μ Cκ° μ£Όμ΄μ§λ€. A, B, Cλ λͺ¨λ 100λ³΄λ€ ν¬κ±°λ κ°κ³ , 1,000λ³΄λ€ μμ μμ°μμ΄λ€.
www.acmicpc.net
λ¬Έμ νΈλ λ° μμ΄ λμμ΄ λλλ‘ λμ νμ΄μ κ°μ λ νμ΄λ₯Ό μ¬λ¦½λλ€.
λν νμ΄ ν λ€λ₯Έ μ¬λμ νμ΄λ₯Ό λ³΄κ³ μ°Έκ³ ν λ§ν νμ΄λ μ¬λ¦½λλ€.
- λ¬Έμ μ λ°λΌ λμ νμ΄λ§ μμ μ μμ΅λλ€.
- ν΄λΉ νμ΄λ€μ νμ΄ μ€ νλμΌ λΏ μ΅μ μ νμ΄λ μλ μ μμ΅λλ€.
λ¬Έμ μ€λͺ
μ£Όμ΄μ§ 3κ°μ μ«μλ₯Ό κ³±νμ¬ λμ¨ κ°μ κ°κ° μ«μλ€μ κ°μλ₯Ό ꡬνμ¬λΌ.
λμ νμ΄
var input = [0,0,0]
for i in 0..<3 { input[i] = Int(readLine()!)! }
var a = Array(String(input.reduce(1,*)))
var dictionary = [0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0]
for i in a {
switch i {
case "0": dictionary[0]! += 1
case "1": dictionary[1]! += 1
case "2": dictionary[2]! += 1
case "3": dictionary[3]! += 1
case "4": dictionary[4]! += 1
case "5": dictionary[5]! += 1
case "6": dictionary[6]! += 1
case "7": dictionary[7]! += 1
case "8": dictionary[8]! += 1
case "9": dictionary[9]! += 1
default: continue
}
}
for i in dictionary.sorted(by: { $0.key < $1.key}) {
print(i.value)
}
0~9κΉμ§μ λμ λ리λ₯Ό λ§λ€μ΄
ν΄λΉνλ μ«μμ += 1μ νμ¬
κ°μ ꡬνμ΅λλ€.
μ°Έκ³ ν λ§ν νμ΄
let a = Int(readLine()!)!
let b = Int(readLine()!)!
let c = Int(readLine()!)!
var n = a * b * c
var characters = [Int](repeating: 0, count: 10)
while n > 0 {
let x = n % 10
characters[x] += 1
n = n / 10
}
for x in characters {
print(x)
}
μκ°ν΄λ³΄λ λμ λ리κΉμ§ λ§λ€κ±° μμ΄
λ°°μ΄μ μΈλ±μ€λ₯Ό μ¬μ©ν΄μ κ°μ ꡬνμΌλ©΄ λλ€μ.
'π€ μκ³ λ¦¬μ¦ > BAEKJOON' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[swift] λ°±μ€ - 4153λ²: μ§κ°μΌκ°ν (0) | 2023.02.01 |
---|---|
[swift] λ°±μ€ - 1085λ²: μ§μ¬κ°νμμ νμΆ (2) | 2023.02.01 |
[swift] λ°±μ€ - 2587λ²: λνκ°2 (0) | 2023.01.29 |
[swift] λ°±μ€ - 10610λ²: 30 (0) | 2023.01.28 |
[swift] λ°±μ€ - 13305λ²: μ£Όμ μ (0) | 2023.01.28 |