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()); + } +}