[求助]You can program in C ++上的一道练习题
书上让把它改成显示所输的数中的最小值,不准用‘>',怎么办哪?
#include<exception>
#include<iostream>
int main(){
try{
int i(0);
int biggest(0);
do{
std::cout << "Type in a positive number";
std::cout << "(zero or a nagative number ends the program):";
std::cin >> i;
if(not std::cin){
std::cout << "The biggest value so far was " << biggest <<'\n';
throw std::exception();
}
if (i<1) break;
if (biggest< i) biggest=i;
}while(true);
std::cout << "The smallest number input was " <<tsmallest << '\n';
}
catch(...){
std::cerr << "***An exception was thrown.***\n";
}
}