Skip to content

Performance fix #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
34 changes: 24 additions & 10 deletions welcome.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,43 @@ int main(int argc, char *argv[]) {
<< "\n";
std::cout << "Hello from Michigan Hackers!\n"
<< "Learn more: https://www.youtube.com/watch?v=dQw4w9WgXcQ\n";

std::cout << "Doing some math...\n";
// Why is this so slow...
// TODO: make it go faster
std::cout << "Input your first favorite number: \n";
int inputNumber1, inputNumber2;
std::cin >> inputNumber1;
while (inputNumber1 > 25) {
std::cout << "no." << std::endl;
std::cout << "Try again." << std::endl;
std::cin >> inputNumber1;
}
std::cout << "Input your second favorite number: \n";
std::cin >> inputNumber2;
std::cout << "fib(" << inputNumber1 << ") = " << fib(inputNumber1) << std::endl;
std::cout << "fib(" << inputNumber2 << ") = " << fib(inputNumber2) << std::endl;
while (inputNumber2 > 25) {
std::cout << "stop it." << std::endl;
std::cout << "Try again." << std::endl;
std::cin >> inputNumber2;
}
std::cout << "fib(" << inputNumber1 << ") = " << fib(inputNumber1)
<< std::endl;
std::cout << "fib(" << inputNumber2 << ") = " << fib(inputNumber2)
<< std::endl;
int arr[] = {5, 3, 9, 8, 3};
// Why is it printing weird things...
std::cout << "Sorting " << *arr << "...\n";
std::cout << "Sorting " << arr << "...\n";
my_sort(arr, 5);
std::cout << "Sorted: " << *arr << "...\n";
std::cout << "Sorted: " << arr << "\n";
// Please delete the line below
std::cout << "Enjoy this whale\n";
std::cout << R"( .
":"
___:____ |"\/"|
,' `. \ /
| O \___/ |
~^~^~^~^~^~^~^~^~^~^~^~^~
)" << '\n';
":"
___:____ |"\/"|
,' `. \ /
| O \___/ |
~^~^~^~^~^~^~^~^~^~^~^~^~
)" << '\n';
std::cout << "Hello, this is Leon!\n";
my_sort(arr, 7);
std::cout << "Sorted: " << arr << "\n";
Expand Down