Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion homework4.txt
Original file line number Diff line number Diff line change
@@ -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.
git의 관리를 받고 싶지 않은 파일들을 .gitignore를 사용하여 설정할 수 있다. .gitignore의 파일들은 git이 tracking 하지 않는다.
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는 git에서 사용하는 인증 시스템이다. 일반적인 비밀번호보다 높은 보안 수준을 가진다.
git에서의 안전한 통신을 위해 git hub의 사용자들은 SSH key를 필요로한다.
19 changes: 10 additions & 9 deletions homework4/Source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,26 @@ 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);
cout << arr[i] << " ";
}
cout << endl;

//Given the int array arr, generate another int array output.
//whose element indiciates how many elements in arr is smaller than arr[i].
//For example, if arr is given as [5,8,5,6,8,1,5,9,5,8],
//output should be [1,6,1,5,6,0,1,9,1,6].

int* output = new int[arrsize];
cout << "Array output: ";

/***********************************
Implement the code here!
************************************/
for (int a = 0; a < arrsize; a++) {
int check = 0;
for (int b = 0; b < arrsize; b++) {
if (arr[a] > arr[b]) {
check++;
}
output[a] = check;
}
}

for (int i = 0; i < arrsize; i++) {
cout << output[i] << " ";
Expand Down