diff --git a/homework4.txt b/homework4.txt index d8160f0..2d6374e 100644 --- a/homework4.txt +++ b/homework4.txt @@ -1,2 +1,5 @@ 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 +깃에서 특정 파일 혹은 디렉토리를 관리 대상에서 제외할 때 사용하는 파일로, 이 파일 안에 기입된 내용들은 모두 깃에서 관리하지 않겠다는 것을 의미. +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를 이용한 작업에서, 내 저장소를 수정할 권한을 가진 사용자임을 인증하는 고유 key. +SSH 공개키 인증 방식을 사용하면 Github 연결(push)시마다 계정정보를 입력해야 하는 번거로움을 줄여 준다. \ No newline at end of file diff --git a/homework4/Source.cpp b/homework4/Source.cpp index ab69b66..bb2e52a 100644 --- a/homework4/Source.cpp +++ b/homework4/Source.cpp @@ -9,7 +9,7 @@ int main() const int arrsize = 10; int* arr = new int[arrsize]; srand((unsigned int)time(NULL)); - cout << "Array arr: " ; + cout << "Array arr: "; for (int i = 0; i < arrsize; i++) { arr[i] = (rand() % 10); @@ -24,10 +24,18 @@ int main() int* output = new int[arrsize]; cout << "Array output: "; + int tr = 0; + for (int k = 0; k < arrsize; k++) { + for (int t = 0; t < arrsize; t++) { + if (arr[k] > arr[t]) { + tr += 1; + } + } + + output[k] = tr; + tr = 0; + } - /*********************************** - Implement the code here! - ************************************/ for (int i = 0; i < arrsize; i++) { cout << output[i] << " ";