From 177bed0131ac21a14abb6c68e7fdcf393a6ccc8b Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Wed, 1 Dec 2021 08:50:04 -0600 Subject: [PATCH] Add a couple scripts --- usaco/Daisy Chain/index.cpp | 22 ++++++++++++++++++++++ usaco/Do You Know Your ABCs?/index.cpp | 12 ++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 usaco/Daisy Chain/index.cpp create mode 100644 usaco/Do You Know Your ABCs?/index.cpp diff --git a/usaco/Daisy Chain/index.cpp b/usaco/Daisy Chain/index.cpp new file mode 100644 index 0000000..987a57b --- /dev/null +++ b/usaco/Daisy Chain/index.cpp @@ -0,0 +1,22 @@ +#include +#include +using namespace std; + +int main() { + int n; + cin >> n; + int flower_array[n]; + for (int i = 0; i < n; i++) { + cin >> flower_array[i]; + } + for (int i = 0; i < n - 1; i++) { + for (int j = 0; j < n - i - 1; j++) { + int k = j + i; + for (int l = 1; l <= k; l++) { + cout << flower_array[l] << " "; + } + cout << endl; + } + } + return 0; +} diff --git a/usaco/Do You Know Your ABCs?/index.cpp b/usaco/Do You Know Your ABCs?/index.cpp new file mode 100644 index 0000000..e6c2c9a --- /dev/null +++ b/usaco/Do You Know Your ABCs?/index.cpp @@ -0,0 +1,12 @@ +#include +using namespace std; + +int main() { + int n[7]; + for (int i = 0; i < 7; i++) { + int j; + cin >> j; + n[i] = j; + sort(n, 7, greater()); + } +}