// homework-09.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <memory>
using namespace std;
template<typename Func>
int alNum(char* ins,char alp,Func func){
int count=0;
int i=0;
int len=strlen(ins);
for(;i<len;i++)
if(func(ins[i],alp))
count++;
return count;
}
int _tmain(int argc, _TCHAR* argv[])
{
unique_ptr<char[]> ins(new char[81]);
gets(ins.get());
auto func=[](char ina, char coma){return ina==coma;};
char al;
al='e';
cout<<"Num of:"<<al<<"
"<<alNum(ins.get(),al,func)<<"
";
al='l';
cout<<"Num of:"<<al<<"
"<<alNum(ins.get(),al,func)<<"
";
system("pause");
return 0;
}