OJ-Problems-Source/HDOJ/5842_lyhylex.cpp

20 lines
328 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

///好厉害~来自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;
}