Abheek Dhawan
3 years ago
2 changed files with 34 additions and 0 deletions
@ -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; |
|||
} |
@ -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…
Reference in new issue