/*
template<class _InIt, class _Ty>
typename iterator_traits<_InIt>::difference_type
count(_InIt _First, _InIt _Last, const _Ty& _Val)
template<class _InIt, class _Pr>
typename iterator_traits<_InIt>::difference_type
count_if(_InIt _First, _InIt _Last, _Pr _Pred)
*/
#include <algorithm>
#include <iostream>
#include <functional>
using namespace std;
bool f( int n )
{ return n >= 3; }
int main()
{
int a[] = {1,1,2,2,3,3,4,4};
// 2 {3,3} operator ==により比較される
cout << count(a,a+8,3) << endl;
// 4 {3,3,4,4}
cout << count_if(a,a+8,f) << endl;
return 0;
}
急上昇Wikiランキング
急上昇中のWikiランキングです。今注目を集めている話題をチェックしてみよう!
最近作成されたWikiのアクセスランキングです。見るだけでなく加筆してみよう!
atwikiでよく見られているWikiのランキングです。新しい情報を発見してみよう!
最近アクセスの多かったページランキングです。話題のページを見に行こう!