#include <iostream> using namespace std; int main() { // read size n, allocate array of n doubles, read values into array int n; cin >> n; double * A = new double[n]; for(int i = 0; i < n; i++) cin >> A[i]; // Now what? return 0; }... and add code after the "Now what?" comment to solve one of the problems below for the array A of n elements created in the first part of the code.
~/$ ./ex1a
4
34 12 8 29
minimum element is A[2] = 8.
Solution: TE7a.cpp
~/$ ./ex1b
4
34 12 8 29
A = [34, 12, 8, 29]
Solution: TE7b.cpp
3 7 8 5 \_/ \_/ \_/ 2 1 -3A run of your program should look like this:
~/$ ./ex1c
4
14 16 8 29
2 -8 21
Solution: TE7c.cpp
~/$ ./ex1d
10
0 1 2 -3 4 -5 -6 7 8 9
negative: -3 -5 -6
positive: 1 2 4 7 8 9
Solution: TE7d.cpp