华为笔试题06

关键部分代码为

	char aa[]="qwyugdtwqfdetgwsfcdtyz";
	char dest[3];
	set<char> a;
	//set<char>::iterator iter=aa;
	a.insert(aa,aa+strlen(aa));	
	for(set<char>::reverse_iterator iter=a.rbegin();iter!=a.rend();iter++)
		cout<<*iter<<" ";
	cout<<endl;
	set<char>::reverse_iterator iter=a.rbegin();
	dest[0]=*(iter++);
	dest[1]=*(iter++);
	dest[2]=*(iter++);

	cout<<dest[0]<<" "<<dest[1]<<" "<<dest[2]<<endl;

  

posted @ 2013-08-23 11:35  一桶白开水  阅读(220)  评论(0编辑  收藏  举报