#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main( )
{
std:: vector < double > balls;
double ball;
char const * const prompt = "\n number?\n > " ;
while ( cout << prompt, cin >> ball)
{
balls.push_back ( ball) ;
sort( balls.begin ( ) , balls.end ( ) ) ;
bool just_another_number = true ;
const std:: size_t size = balls.size ( ) ;
if ( ball == balls.front ( ) )
{
if ( size == 1 || size > 1 && balls[ 1 ] ! = ball)
{
just_another_number = false ;
cout << ball << " is the smallest number yet!\n " ;
}
}
if ( ball == balls.back ( ) )
{
if ( size == 1 || size > 1 && balls[ balls.size ( ) - 2 ] ! = ball)
{
just_another_number = false ;
cout << ball << " is the largest number yet!\n " ;
}
}
if ( just_another_number)
cout << '\n ' << ball << " is just another number.\n " ;
}
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkKewogICAgc3RkOjp2ZWN0b3I8ZG91YmxlPiBiYWxsczsKCiAgICBkb3VibGUgYmFsbDsKICAgIGNoYXIgY29uc3QqIGNvbnN0IHByb21wdCA9ICJcbm51bWJlcj9cbj4gIjsgCiAgICB3aGlsZSAoY291dCA8PCBwcm9tcHQsIGNpbiA+PiBiYWxsKQogICAgewogICAgICAgIGJhbGxzLnB1c2hfYmFjayhiYWxsKTsKICAgICAgICBzb3J0KGJhbGxzLmJlZ2luKCksIGJhbGxzLmVuZCgpKTsKCiAgICAgICAgYm9vbCBqdXN0X2Fub3RoZXJfbnVtYmVyID0gdHJ1ZTsKCiAgICAgICAgY29uc3Qgc3RkOjpzaXplX3Qgc2l6ZSA9IGJhbGxzLnNpemUoKTsKICAgICAgICBpZiAoYmFsbCA9PSBiYWxscy5mcm9udCgpKQogICAgICAgIHsKICAgICAgICAgICAgaWYgKHNpemUgPT0gMSB8fCBzaXplID4gMSAmJiBiYWxsc1sxXSAhPSBiYWxsKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBqdXN0X2Fub3RoZXJfbnVtYmVyID0gZmFsc2U7CiAgICAgICAgICAgICAgICBjb3V0IDw8IGJhbGwgPDwgIiBpcyB0aGUgc21hbGxlc3QgbnVtYmVyIHlldCFcbiI7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIGlmIChiYWxsID09IGJhbGxzLmJhY2soKSkKICAgICAgICB7CiAgICAgICAgICAgIGlmIChzaXplID09IDEgfHwgc2l6ZSA+IDEgJiYgYmFsbHNbYmFsbHMuc2l6ZSgpIC0gMl0gIT0gYmFsbCkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAganVzdF9hbm90aGVyX251bWJlciA9IGZhbHNlOwogICAgICAgICAgICAgICAgY291dCA8PCBiYWxsIDw8ICIgaXMgdGhlIGxhcmdlc3QgbnVtYmVyIHlldCFcbiI7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIGlmIChqdXN0X2Fub3RoZXJfbnVtYmVyKQogICAgICAgICAgICBjb3V0IDw8ICdcbicgPDwgYmFsbCA8PCAiIGlzIGp1c3QgYW5vdGhlciBudW1iZXIuXG4iOwogICAgfQp9