Fix the variable typo and add the function call (#109)

This commit is contained in:
fdrvrtm
2019-11-12 17:19:09 +02:00
committed by Aditya Bhargava
parent 0377eab73c
commit 30bbe9cf01
2 changed files with 2 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ void greet(std::string name) {
cout << "Hello, " + name + "!" << endl;
greet2(name);
cout << "Getting ready to say bye..." << endl;
bye();
}

View File

@@ -10,7 +10,7 @@ T sum(std::vector<T> arr) {
T last_num = arr.back(); // save last number value
arr.pop_back(); // and remove it from array for next recursive call
return first_num + sum(arr);
return last_num + sum(arr);
}
int main() {