From d9fa4ba068409441206e70497b83b63b6d5bdcdc Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Tue, 24 May 2016 15:27:19 +0800 Subject: [PATCH] Create 1520.cpp --- QUSTOJ/1520.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 QUSTOJ/1520.cpp diff --git a/QUSTOJ/1520.cpp b/QUSTOJ/1520.cpp new file mode 100644 index 0000000..d4c5507 --- /dev/null +++ b/QUSTOJ/1520.cpp @@ -0,0 +1,19 @@ +#include +int cnt[26]; + +int main() +{ + char c; + while((c=fgetc(stdin))!='#') + { + if(c>='a'&&c<='z') + { + ++cnt[c-'a']; + } + } + for(int i=0;i<26;i++) + { + printf("%c %d\n",i+'a',cnt[i]); + } + return 0; +}