diff --git a/homework4.txt b/homework4.txt index d8160f0..701df19 100644 --- a/homework4.txt +++ b/homework4.txt @@ -1,2 +1,7 @@ 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 의 관리대상에서 특정 파일이나 디렉토리를 제외할때 쓰는 파일이다. + +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 키는 사용자를 식별하는 키이다. public key 와 private key 가 있는데 public key 는 공유 서비스에서 사용되고, private key 는 개인 컴퓨터에 저장된다. 이 키가 일치하면 사용자에게 권한이 부여되는 방식으로서 타인이 나의 파일에 임의로 PUSH 하는 것을 방지한다. 매번 유저네임과 비밀번호를 입력할 필요를 없게 해주기 때문에 필요하다. diff --git a/homework4/Source.cpp b/homework4/Source.cpp index ab69b66..e2c640b 100644 --- a/homework4/Source.cpp +++ b/homework4/Source.cpp @@ -24,13 +24,18 @@ int main() int* output = new int[arrsize]; cout << "Array output: "; - - /*********************************** - Implement the code here! - ************************************/ + for (int a = 0; a < arrsize; a++) { + int smaller = 0; + for (int i = 0; i < arrsize; i++) { + if (arr[i] < arr[a]) { + smaller++; + } + } + output[a] = smaller; + } for (int i = 0; i < arrsize; i++) { cout << output[i] << " "; } return 0; -} \ No newline at end of file +}