diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..af4d38d Binary files /dev/null and b/.DS_Store differ diff --git a/hello01.js b/hello01.js new file mode 100644 index 0000000..6be0237 --- /dev/null +++ b/hello01.js @@ -0,0 +1 @@ +console.log('hello world'); diff --git a/prob1.js b/prob1.js index 2eed222..e50c115 100644 --- a/prob1.js +++ b/prob1.js @@ -1,7 +1,15 @@ //1. 함수 로직 작성 문제 function solution(num, total) { - let answer = []; + let answer = []; + let avg= total/num; + let start = avg- (num-1)/2; + + for(let i=0;i likelion[j].age) { + let temp = likelion[i]; + likelion[i] = likelion[j]; + likelion[j] = temp; + } + } +} +console.log("오름차순", likelion); -// 2번 문제 코드작성 + +// 2번 문제 코드작성 +// 나이를 돌면서 24세 이상인 경우에만 결과 배열에 푸시 해보기 let result2 = []; +let criteria= 24; +for (let i=0;i=criteria){ + result2.push(likelion[i]); + + } + + + +} console.log(result2); // 3번 문제 코드작성 +// 그냥 돌면서 이름 같은 사람찾고 foundPerson.part let targetName = "전수빈"; -let result3 = null; +let result3 = null; +for (let i=0;i