From f5d4753ee3896a113414ad625280d42bb2a3bd43 Mon Sep 17 00:00:00 2001 From: suseong Date: Fri, 17 Apr 2020 04:43:19 +0900 Subject: [PATCH] homework --- homework4.txt | 6 +++++- homework4/Source.cpp | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/homework4.txt b/homework4.txt index d8160f0..258e2e3 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 +Git¿¡°Ô º» ÆÄÀÏ/Æú´õ¸¦ ¹«½ÃÇϵµ·Ï Áö½ÃÇÏ´Â ÅØ½ºÆ® ÆÄÀÏÀÌ´Ù. º¸Åë ÃÖ»óÀ§ µð·ºÅ丮¿¡ Á¸ÀçÇÑ´Ù. +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. +github¸¦ ÀÌ¿ëÇÒ ¶§ ÀúÀå¼Ò¿¡ ÆÄÀÏÀ» ¾÷·ÎµåÇØ¾ß ÇÒ Çʿ䰡 ÀÖ´Ù. À̶§ ¸í·É¾î·Î´Â git push¸¦ +ÀÌ¿ëÇÏÁö¸¸ ÀÌ °úÁ¤¿¡¼­ ÀúÀå¼Ò¸¦ ¼öÁ¤ÇÒ ±ÇÇÑÀ» È®ÀÎÇØ¾ß ÇÑ´Ù. À̶§ github info ´ë½Å SSH key¸¦ ÀÌ¿ëÇÏ´Â °ÍÀº +ÀúÀå¼Ò¿¡ Á¢¼ÓÇÒ ¶§¸¶´Ù ¾ÆÀ̵ð¿Í ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏÁö ¾Ê¾Æµµ µÇ¹Ç·Î https ¹æ½Äº¸´Ù ´õ °£ÆíÇÏ´Ù´Â ÀåÁ¡ÀÌ ÀÖ´Ù. \ No newline at end of file diff --git a/homework4/Source.cpp b/homework4/Source.cpp index ab69b66..57c4fa0 100644 --- a/homework4/Source.cpp +++ b/homework4/Source.cpp @@ -16,6 +16,7 @@ int main() 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]. @@ -24,6 +25,15 @@ int main() int* output = new int[arrsize]; cout << "Array output: "; + for (int i = 0; i < 10; i++) { + int count = 0; + for (int i2 = 0; i2 < 10; i2++) { + if (arr[i] > arr[i2]) { + count++; + } + } + output[i] = count; + } /*********************************** Implement the code here!