/*
Declare a one-dimensional array of type float and of maximum size 100. 
Then ask the user to enter the actual size of the array (the number of 
elements that will be used). The read the array. Then find the maximum 
(largest) element of the array. 
*/
#include <iostream>
using namespace std;
int main()
{
	int i, n;
	float a[100], max;
	cout << "Enter the actual size: ";
	cin >> n;
	if (n > 0 && n <= 100)
	{
		cout << "Enter the array: ";
		for (i=0; i < n; i++)
			cin >> a[i];
		max = a[0];
		for (i = 1; i < n; i++)
			if (a[i] > max)
				max = a[i];
		cout << "The largest element is: " << max << endl;
	}
	else
		cout << "Invalid input: size must be < 101.\n";
	return 0;
}
