diff --git a/homework4.txt b/homework4.txt index d8160f0..731e6e9 100644 --- a/homework4.txt +++ b/homework4.txt @@ -1,2 +1,8 @@ 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 repository에 넣지 않고, git add . 을 이용해 변경된 파일 전체를 staging area에 추가하고 commit 하는 경우에 보안상으로 위험성이 있거나/프로젝트와 관계 없거나/용량이 너무 커서 제외하고 싶은 파일들을 .gitignore 이라는 디렉토리에 넣어줌으로써 무시하고 제외시킬 수 있다. + +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. + + 인증되지 않은 사용자에 의해 github 서버에 존재하는 작업물들이 훼손되고 손실되는 것을 방지하기 위해 SSH key를 필요로 한다. 오로지 SSH key를 통해 인증된 사용자만 push 작업을 할 수 있다. PC에서 github repository에 작업물을 업데이트 할 때 본인이 PC의 주인임을 인증해야 하는데, 이 인증 작업에 사용되는 것이 바로 SSH key 인 것이다. + git bash를 통해 PC에서 SSH key를 생성하고, SSH key 정보를 github에 등록하고 나면 push를 자유롭게 할 수 있다. diff --git a/homework4/2019-13875.zip b/homework4/2019-13875.zip new file mode 100644 index 0000000..dc7988e Binary files /dev/null and b/homework4/2019-13875.zip differ diff --git a/homework4/Source.cpp b/homework4/Source.cpp index ab69b66..78a7502 100644 --- a/homework4/Source.cpp +++ b/homework4/Source.cpp @@ -24,10 +24,17 @@ int main() int* output = new int[arrsize]; cout << "Array output: "; - - /*********************************** - Implement the code here! - ************************************/ + int count = 0; + for (int i = 0; i < arrsize; i++) + { + for (int j = 0; j < arrsize; j++) + { + if (arr[i] > arr[j]) + count++; + } + output[i] = count; + count = 0; + } for (int i = 0; i < arrsize; i++) { cout << output[i] << " ";