/* * Programmieren fuer Physiker, WS 2009/10 * * Klausur, Aufg. 2 */ #include using namespace std ; // --------- nur diese Funktion ist gefragt ! bool is_monoton (double a[], int n) { for( int i=0; i a[i+1]) return false ; return true ; } // --------- Ende der Funktion ! int main() { const int n = 4 ; double a[n] = {1.1, 2.2, 2.1, 3.3} ; double b[n] = {1.1, 2.2, 3, 4} ; cout << "Monotonietest: " << is_monoton(a,n) << endl ; cout << "Monotonietest: " << is_monoton(b,n) << endl ; }