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
6 changes: 5 additions & 1 deletion homework4.txt
Original file line number Diff line number Diff line change
@@ -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.
.gitignore file is a list of files that are not useful so you want to ignore in your working directory, such as backup file, log file, or complilation products.

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 keys are pair of public key that get shared with services like GitHub, and a private key that is stored only on your computer. When keys are match, you can get access.
SSH key is an alternate way to identify yourself so that you are not required to enter your username and password every time.
Binary file added homework4/2019-16726.zip
Binary file not shown.
19 changes: 9 additions & 10 deletions homework4/Source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <time.h>
using namespace std;


int main()
{
const int arrsize = 10;
Expand All @@ -17,17 +16,17 @@ int main()
}
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 t = 0; t < arrsize; t++) {
int num = 0;
for (int j = 0; j < arrsize; j++) {
if (arr[t] > arr[j]) {
num++;
}
}
output[t] = num;
}

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