设为首页 加入收藏

TOP

对容器元素进行排序
2014-11-23 19:52:26 来源: 作者: 【 】 浏览:7
Tags:容器 元素 进行 排序
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;

bool isShorter(const string &s1,const string &s2)
{
	return s1.size()=6;
}
string make_plural(size_t ctr,const string &word, const string &ending)
{
	return (ctr==1) word:word+ending;//make_plural(wc, "word ", "s ")当输入中文本中
	                                     //word数大于一是在word后加s,为words为word的复数!
}
int main()
{
	//words:the quick red fox jumps over the slow red turtle
	vector words;
	vector::iterator noUnique;
	//将单词添加入vector
	words.push_back(string("the"));
	words.push_back(string("quick"));
	words.push_back(string("red"));
	words.push_back(string("fox"));
	words.push_back(string("jumps"));
	words.push_back(string("over"));
	words.push_back(string("the"));
	words.push_back(string("slow"));
	words.push_back(string("red"));
	words.push_back(string("turtle"));

	//原样输出单词
	cout<<"before sort:"<::iterator iter=words.begin();iter!=words.end();++iter)
	{
		cout << *iter<::size_type wc=count_if(words.begin(),words.end(),GT6);
	cout< 
 

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇ACM 1001 Exponentiation 高精度.. 下一篇POJ 2411 Mondriaan's Dream ..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·求navicat for mysql (2025-12-26 13:21:33)
·有哪位大哥推荐一下m (2025-12-26 13:21:30)
·MySQL下载与安装教程 (2025-12-26 13:21:26)
·Linux_百度百科 (2025-12-26 12:51:52)
·Shell 流程控制 | 菜 (2025-12-26 12:51:49)