//============================================================================ // Name : increasing-numbers.cpp // Author : R. W. Hasker // Version : // Description : Reads floats and checks if they are in increasing order // (using the loose increasing constraint that is really // not decreasing: adjacent numbers can be the same). //============================================================================ #include using namespace std; const int MAX_NUMBERS = 10; int main() { int count = 0; float nums[MAX_NUMBERS]; float x; cin >> x; while (cin && count < MAX_NUMBERS) { nums[count] = x; ++count; cin >> x; } int pos = 0; while (pos < count - 1 && nums[pos] < nums[pos + 1]) ++pos; if (pos < count - 1) cout << "Sorry, didn't always increase." << endl; else cout << "Increasing." << endl; return 0; }