运行后,对我的输入,没有输出,为何???
运行后,对我的输入,没有输出,为何???
#include <iostream>
#include <string>
#include <set>
using namespace std;
typedef set<string,less<string> >str_set;
void main()
{
string name[]={"Mary","John","Ann","Joe","Ken"};
str_set s(name,name+5);
string search,upper,lower;
str_set::iterator iter;
cout<<"please input a range for searching:(Upper/Lower)\n";
cin>>upper>>lower;
for(iter=s.lower_bound(lower);iter!=s.upper_bound(upper);iter++)
cout<<*iter<<" ";//好想没执行????
cout<<endl;
}