From 912e58eb1f9be3fe226faac2a80dcbdb5b90a3b0 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Sun, 14 Aug 2016 18:29:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=BD=E5=8E=89=E5=AE=B3=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 来自 http://blog.csdn.net/kiritow/article/details/52205164 评论 1L --- HDOJ/5842_lyhylex.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 HDOJ/5842_lyhylex.cpp diff --git a/HDOJ/5842_lyhylex.cpp b/HDOJ/5842_lyhylex.cpp new file mode 100644 index 0000000..56015ae --- /dev/null +++ b/HDOJ/5842_lyhylex.cpp @@ -0,0 +1,19 @@ +///好厉害~!来自lyhylex (CSDN) +#include +#include +#include +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; +}