//Xinnuo Wang                   CS1A                   chapter 5 , P.296, #13
//
/*******************************************************************************
*
* Display the Lagest and Smallest Number 
*-------------------------------------------------------------------------------
* This program accepts a series of integers, and displays the largest and 
* smallest numbers. The value -99 ends the series.
*
*-------------------------------------------------------------------------------
* INPUT
*    num       : The accepted series number.
*   
* OUTPUT
*     max       : The max number
*     min       : The min number
*
*******************************************************************************/
#include <iostream>
using namespace std;

int main() 
{
	int num; //INPUT - The accepted number.
	int max, min;//OUTPUT 
//
//Initialization
    cout<< "Enter a number: ";
    cin >> num;
    cout<< num << endl;
    max = num;
    min = num;
    while(num!=-99)
    {
        if(num >max)
        max = num;
        if(num< min)
        min = num;
        cout<< "Enter a number: ";
        cin>> num;
        cout << num << endl;
    }
//
//Output Result
    cout <<"The max number is :"<<max<<endl;
    cout<< "The min number is :" << min<< endl;
	return 0;
}