好厉害的代码!

来自 http://blog.csdn.net/kiritow/article/details/52205164 评论 1L
This commit is contained in:
Kirigaya Kazuto 2016-08-14 18:29:52 +08:00 committed by GitHub
parent 992ee0ae8b
commit 912e58eb1f

19
HDOJ/5842_lyhylex.cpp Normal file
View File

@ -0,0 +1,19 @@
///好厉害~来自lyhylex (CSDN)
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
char s[100000 + 9];
int main()
{
int ca = 1, t;
scanf("%d", &t);
while (t--)
{
scanf("%s", s);
int n = strlen(s);
sort(s, s + n);
printf("Case #%d: %d\n", ca++, unique(s, s + n) - s);
}
return 0;
}