标签:hdu2072
you are my friend #
4
#include <iostream> #include <set> #include <string> #include <cstdio> #include <cstring> using namespace std; char str2[10000], *p; int main() { set<string> st; char str[1000]; int count = 0; while(gets(str2)){ if(!strcmp(str2, "#")) break; p = strtok(str2, " "); while(p){ sscanf(p, "%s", str); if(!st.count(str)) st.insert(str); p = strtok(NULL, " "); } cout << st.size() << endl; st.clear(); } return 0; }
HDU2072 单词数 【STL】+【strtok】,布布扣,bubuko.com
标签:hdu2072
原文地址:http://blog.csdn.net/chang_mu/article/details/38146931