From c362a2a29730fb13e3561f6fb81eb0e025c73537 Mon Sep 17 00:00:00 2001 From: DaffaBarin Date: Sat, 25 Jan 2020 14:24:09 +0700 Subject: [PATCH 1/2] Update main.cpp --- main.cpp | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index f439d60..0e0f76f 100644 --- a/main.cpp +++ b/main.cpp @@ -6,7 +6,7 @@ using namespace std; /** WRITE DOWN YOUR INFORMATION HERE */ string name = ""; // put your name here string ID = ""; // put your student id here -int group_id = 0; // your Group Number here (1-8) +int group_id = 3; // your Group Number here (1-8) /** FUNCTIONS LIST, DO NOT MODIFY THESE */ @@ -87,6 +87,19 @@ void insert_first(int arr[], int &n, int x) { // YOUR CODES HERE //----------------------- + int i; + + if (n<20) { + for (i=n-1;i>=0;i--){ + arr[i+1]=arr[i]; + } + arr[0]=x; + n++; + + }; + else { + cout<<"Data penuh"; + } //----------------------- @@ -182,7 +195,18 @@ void swap_data(int arr[], int n) { // YOUR CODES HERE //----------------------- + int a=1; + //int temp; + int k; + k = n-1; + for (int i =0;i Date: Sat, 25 Jan 2020 14:34:34 +0700 Subject: [PATCH 2/2] Update main.cpp --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 0e0f76f..0fc81ac 100644 --- a/main.cpp +++ b/main.cpp @@ -4,8 +4,8 @@ using namespace std; /** WRITE DOWN YOUR INFORMATION HERE */ -string name = ""; // put your name here -string ID = ""; // put your student id here +string name = "Daffa Barin Tizard Riyadi;Muh Fachrul Hidayat;Muhammad Kamil Hasan;Hazim Ismail"; // put your name here +string ID = "1301190369;1301194066;1301190420;1301194149"; // put your student id here int group_id = 3; // your Group Number here (1-8)