标签:
you are my friend #
4
#include<iostream> #include<algorithm> #include<string> #include<string.h> using namespace std; int main() { char a[1000]; string b[1000]; int i; while(gets(a)) { int k=0; if(strcmp(a,"#")==0) break; else { char *p; p=strtok(a," "); while(p) //you are my friend { b[k++]=p; p=strtok(NULL," "); } sort(b,b+k); //aaaabbc int count=0;//abc for(i=0;i<k;i++) { while(i<k-1 && b[i]==b[i+1]) { i++; } count++; } cout<<count<<endl; } } return 0; }
标签:
原文地址:http://blog.csdn.net/zuguodexiaoguoabc/article/details/43766067