#include using namespace std; #include "Rational.h" // Rational number test program int main( ) { Rational x; Rational sum = 0; Rational max = 0; int n = 0; cout << "Type as many rational numbers as you want\n"; while( cin >> x ) { cout << "Read " << x << '\n'; sum += x; if( x > max ) max = x; n++; } cout << "Read " << n << " rationals\n"; if( max > IntType( 0 ) ) cout << "Largest positive number is " << max << '\n'; if( n > 0 ) cout << "Average is " << sum / IntType( n ) << '\n'; return 0; }