标签:
#include <iostream>
#include <string>
#include <map>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main()
{
char c;
map<string,int> word;
while((c=getchar() )!=‘#‘)
{
string temp="";
while(c!=‘\n‘&&c!=‘ ‘&&c!=‘#‘)
{
temp+=c;
c=getchar();
}
//int m=word.size();
if(c==‘#‘) return 0;
if(temp.length() ) word.insert(map<string,int> :: value_type(temp,0)) ;
if(c==‘\n‘)
{cout<<word.size()<<endl; word.clear();}
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/sober-reflection/p/96175a1bdcc7ff926bbcfc839eb605c4.html