diff --git a/homework4.txt b/homework4.txt index d8160f0..12fa279 100644 --- a/homework4.txt +++ b/homework4.txt @@ -1,2 +1,9 @@ -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 +1. What is .gitignore? You can write the answer either in Korean or English. + git으로 project를 관리할 때 프로젝트 설정 파일, 로그 파일, 컴파일 된 파일 등과 같이 관리할 필요가 없는 파일들이 있다. + .git ignore은 이러한 파일들을 git에서 관리하지 않도록 제외할 때 사용하는 파일이다. + +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는 username과 password를 입력하지 않더라도 Github에 연결할 수 있도록 해준다. +Github 사용자들은 SSH 프로토콜을 사용하여 원격 서버 및 서비스에 연결 및 인증하기 위해 SSH key pair가 필요하다. +인증하지 않은 사용자들이 공유 서버에 있는 작업물을 임의로 조작하거나 훼손할 수 있기 때문에, +SSH key를 통해 인증이 된 사용자에게만 변경된 내용을 업데이트 할 수 있는 권한이 주어진다. \ No newline at end of file diff --git a/homework4/Source.cpp b/homework4/Source.cpp index ab69b66..3057264 100644 --- a/homework4/Source.cpp +++ b/homework4/Source.cpp @@ -24,10 +24,17 @@ int main() int* output = new int[arrsize]; cout << "Array output: "; + 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; + } - /*********************************** - Implement the code here! - ************************************/ for (int i = 0; i < arrsize; i++) { cout << output[i] << " ";