From aa2781de68987d430f29cba7d20d64a22cbf84c6 Mon Sep 17 00:00:00 2001 From: jiyu Date: Fri, 17 Apr 2020 14:53:36 +0900 Subject: [PATCH 1/2] modify and add --- homework4/Source.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/homework4/Source.cpp b/homework4/Source.cpp index ab69b66..39aacf9 100644 --- a/homework4/Source.cpp +++ b/homework4/Source.cpp @@ -25,12 +25,24 @@ int main() int* output = new int[arrsize]; cout << "Array output: "; - /*********************************** - Implement the code here! - ************************************/ + int howmany = 0; + + for (int i = 0; i < arrsize; i++) { + for (int j = 0; j < arrsize; j++) { + if (arr[j] < arr[i]) { + howmany += 1; + } + } + output[i] = howmany; + howmany = 0; + } for (int i = 0; i < arrsize; i++) { cout << output[i] << " "; } + + delete[] arr; + delete[] output; + return 0; -} \ No newline at end of file +} From 9eadd505a780b1d6fa273de211004151c9e21525 Mon Sep 17 00:00:00 2001 From: jiyu Date: Fri, 17 Apr 2020 14:57:55 +0900 Subject: [PATCH 2/2] add answer --- homework4.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homework4.txt b/homework4.txt index d8160f0..c31f9bd 100644 --- a/homework4.txt +++ b/homework4.txt @@ -1,2 +1,6 @@ 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. + +1. .gitignore란, 이 파일 안의 내용들을 git의 관리 대상에서 제외할 때 쓰는 파일이다. + +2.SSH key 는 github계정에 특정 컴퓨터를 등록하게 하는 고유 키로, 매번 컴퓨터에서 아이디와 비밀번호를 입력하지 않아도 되는 이점이 있어 사용한다.