From fc7e124be3d200dad3151d73cd8f98a90456e41c Mon Sep 17 00:00:00 2001 From: Kevin Buffardi Date: Sat, 21 Sep 2024 13:18:03 -0700 Subject: [PATCH] Add initial running program --- main.cpp | 27 +++++++++++++++++++++++++++ test_runner.sh | 4 ++++ 2 files changed, 31 insertions(+) create mode 100644 main.cpp create mode 100755 test_runner.sh diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..f2ddce4 --- /dev/null +++ b/main.cpp @@ -0,0 +1,27 @@ +#include +#include + +using std::cout, std::cin, std::endl, std::string, std::vector; + +int main(){ + string input = ""; + vector list; + + do{ + if( list.size() == 0 ){ + cout << "What is your favorite?\n"; + } + else{ + cout << "What is your next favorite?\n"; + } + cin >> input; + list.push_back(input); + }while( input != "done" ); + + cout << "Your favorite list:\n"; + for(int i = 0; i < list.size(); i++){ + cout << list.at(i) << endl; + } + + return 0; +} \ No newline at end of file diff --git a/test_runner.sh b/test_runner.sh new file mode 100755 index 0000000..d9fb49a --- /dev/null +++ b/test_runner.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +g++ main.cpp --std=c++17 -o MyFave +./MyFave \ No newline at end of file