diff --git a/homework4.txt b/homework4.txt index d8160f0..0bb2e88 100644 --- a/homework4.txt +++ b/homework4.txt @@ -1,2 +1,12 @@ 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 + +.gitignore이란 진행 중인 프로젝트에 원치 않는 특정 파일 또는 디렉토리 등을 Git의 관리 대상에서 +제외할 수 있도록 하는 설정 File로 볼 수 있다. + +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는 public key 암호 방식인데, 이는 우리가 일반적으로 사용하는 아이디-비밀번호 방식보다 +더 높은 수준의 보안을 제공한다. 키를 생성하면 비공개키와 공개키 2개의 키가 만들어지는데, 이 중 +공개키는 항상 노출의 위험이 있다. 반면 비공개키는 노출의 위험이 거의 없으며, 따라서 클라이언트가 +서버에 어떤 정보를 요청했는지는 해커들이 상대적으로 알기 쉬우나, 서버가 클라이언트에 어떤 정보를 보냈는지는 +알기가 매우 어렵다. \ No newline at end of file diff --git a/homework4/Source.cpp b/homework4/Source.cpp index ab69b66..64be089 100644 --- a/homework4/Source.cpp +++ b/homework4/Source.cpp @@ -24,10 +24,15 @@ int main() int* output = new int[arrsize]; cout << "Array output: "; - - /*********************************** - Implement the code here! - ************************************/ + for (int i = 0, i < arrsize; i++) { + int n = 0; + for (int j = 0, j < arrsize; j++) { + if (arr[i] > arr[j]) { + n += 1; + } + output[i] = n; + } + } for (int i = 0; i < arrsize; i++) { cout << output[i] << " ";