From 66572f8aa0abe38b4a93be6103c853660e648504 Mon Sep 17 00:00:00 2001 From: smallkun Date: Thu, 20 Feb 2025 20:09:29 +0800 Subject: [PATCH] Auto commit --- 2207/C语言同步练习/循环结构/1.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 2207/C语言同步练习/循环结构/1.c diff --git a/2207/C语言同步练习/循环结构/1.c b/2207/C语言同步练习/循环结构/1.c new file mode 100644 index 0000000..fcce1a0 --- /dev/null +++ b/2207/C语言同步练习/循环结构/1.c @@ -0,0 +1,30 @@ +#include + + +/* +1.ַѭ +while((ch=getchar())!='\n') + +2.жַ +ASCALL뷶Χ + +*/ +int main(){ + + char ch; + int l, d, o;//lĸĸ dΪָ oΪַ + l=d=o=0; + while((ch=getchar()) != '\n'){ + if(ch >= 'a' && ch<='z' || ch >= 'A' && ch<='Z' ){ + l++; + }else if(ch >= '0' && ch <= '9'){ + d++; + }else{ + o++; + } + } + printf("ĸ:%d ָ:%d %d\n", l, d, o); + + + return 0; +}