diff --git a/homework4.txt b/homework4.txt index d8160f0..f120eba 100644 --- a/homework4.txt +++ b/homework4.txt @@ -1,2 +1,6 @@ 1. What is .gitignore? You can write the answer either in Korean or English. -2. Why do Github users need an SSH key pair? (Users can use either SSH key pair or github account info.) Please write down a brief explanation of SSH key. \ No newline at end of file +git에서 commit 등 관리를 진행할 때 관리하지 않는 형식의 파일 목록을 말한다. + +2. Why do Github users need an SSH key pair? (Users can use either SSH key pair or github account info.) Please write down a brief explanation of SSH key. +SSH key를 이용하지 않는다면, 오픈 소스를 이용하는 사용자들이 무분별하게 push를 할 가능성이 있다. +그럴 경우, 원본의 파일들이 없어질 수 있기 때문에 SSH key가 존재하는 사람만 push를 할 수 있게끔 하는 것이다. \ No newline at end of file diff --git a/homework4/Source.cpp b/homework4/Source.cpp index ab69b66..51a7a66 100644 --- a/homework4/Source.cpp +++ b/homework4/Source.cpp @@ -25,9 +25,13 @@ int main() int* output = new int[arrsize]; cout << "Array output: "; - /*********************************** - Implement the code here! - ************************************/ + for (int i = 0; i < arrsize; i++) { + int cnt = 0; + for (int j = 0; j < arrsize; j++) { + if (arr[i] > arr[j]) cnt++; + } + output[i] = cnt; + } for (int i = 0; i < arrsize; i++) { cout << output[i] << " ";