Browse Source

Add a couple scripts

square-pasture
Abheek Dhawan 3 years ago
parent
commit
177bed0131
  1. 22
      usaco/Daisy Chain/index.cpp
  2. 12
      usaco/Do You Know Your ABCs?/index.cpp

22
usaco/Daisy Chain/index.cpp

@ -0,0 +1,22 @@
#include <algorithm>
#include <iostream>
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;
}

12
usaco/Do You Know Your ABCs?/index.cpp

@ -0,0 +1,12 @@
#include <iostream>
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<int>());
}
}
Loading…
Cancel
Save