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계정에 특정 컴퓨터를 등록하게 하는 고유 키로, 매번 컴퓨터에서 아이디와 비밀번호를 입력하지 않아도 되는 이점이 있어 사용한다. 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 +}