fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <set>
  4. #include <map>
  5. #include <string>
  6. #include <iostream>
  7. using namespace std;
  8.  
  9. map<string,int> m;
  10.  
  11. int main()
  12. {
  13. string str, tmp;
  14. int i;
  15. while(getline(cin,str)) {
  16. if(str =="#") break;
  17. m.clear();
  18. i = 0;
  19. int len = str.size();
  20. while(i<len){
  21. tmp = "";
  22. while(i<len&&'a'<=str[i]&&str[i]<='z') tmp +=str[i++];
  23. if(tmp !="")
  24. {
  25. m[tmp] = 1;
  26. }
  27. i++;
  28. }
  29. cout<<m.size()<<endl;
  30. }
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 0s 3344KB
stdin
Standard input is empty
stdout
Standard output is empty