码迷,mamicode.com
首页 > 其他好文 > 详细

statistic

时间:2016-08-16 00:27:17      阅读:122      评论:0      收藏:0      [点我收藏+]

标签:

struct Student

{

std::string groupNo;

std::string No;

viclint void clear()

{

    groupNO.clear();

    No.clear();

}

bool operator< (const Student& l, const Student r)

{

        return (l.groupNum < r.groupNum)

        ||((l.groupNum == r.groupNum ) && (l.No < r.No));

}

typedef std::map<Student, count> Student2Count;

Student2Count m_Student2CountMap;

Student key;

Student2Count::iterator cit = m_Student2CountMap.lower_bound(key);

if(cit != m_Student2CountMap.end() && !m_Student2CountMap.key_comp()(key, it->first()))

{

        m_num += 1;

}

else

{

        m_Student2CountMap.insert(make_pair(key,m_num);

}

statistic

标签:

原文地址:http://www.cnblogs.com/streams/p/5774724.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!