728x90
728x90
728x90
let john = { name: "John", surname: "Smith", id: 1 }; let pete = { name: "Pete", surname: "Hunt", id: 2 }; let mary = { name: "Mary", surname: "Key", id: 3 }; let users = [ john, pete, mary ]; let usersMapped = /* ... your code ... */ /* usersMapped = [ { fullName: "John Smith", id: 1 }, { fullName: "Pete Hunt", id: 2 }, { fullName: "Mary Key", id: 3 } ] */ alert( usersMapped[0].id ) // 1 alert( usersMapped[0].fullName ) // John Smith
728x90
728x90
728x90
728x90
728x90
728x90

https://www.acmicpc.net/problem/2752

😢 단순 비교도 가능하지만, 정렬로 쉽게 풀 수 있는 문제

😊 각종 정렬을 이용해 풀 수 있음(여기선 선택정렬 selection sort)

'Algorithm > C&C++' 카테고리의 다른 글

백준 2753번: 윤년(c++)  (0) 2021.09.29
백준 1000번: A+B(c++)  (0) 2021.09.27
백준 10871번: X보다 작은 수 c++(cpp)  (0) 2021.09.06
백준 10804번: 카드 역배치 c++(cpp)  (0) 2021.09.02
백준 2440번: 별 찍기 - 3 c++(cpp)  (0) 2021.09.01
728x90

https://www.acmicpc.net/problem/10871

😢 N개의 수열을 받아서 X보다 작은지 판단하는 문제

😊 N, X을 먼저 입력받고, N만큼 loop, a는 X보다 작은지 판단하여 출력

+ Recent posts