#include <iostream>
using namespace std;
int main() {
intmax(0),
min(0),
current;
boolfirst = true;
while(1) {
cout<< "Input number: ";
cin>> current;
if(first) {
max= current;
min= current;
first= false;
}
cout<< "Your number is " << current;
if(current >= max) {
max= current;
cout<< " the largest so far";
}
if(current <= min) {
min= current;
cout<< " the smallest so far";
}
cout<< endl;
}
return0;
}
Comments
Leave a comment