Add 字符分类统计

master
pgts2hu9l 4 years ago
parent 0081058179
commit 71a703702d

@ -0,0 +1,19 @@
#include<stdio.h>
int main()
{
char ch;
int n1=0,kgg=0,n2=0,other=0;
while((ch=getchar())!=\n)
{
if((ch>=a&&ch<=z)||(ch<=Z&&ch>=A))
n1++;
else if(ch== )
kg++;
else if(ch>=0&&ch<=9)
n2++;
else
other++;
}
printf(“%d %d %d %d”,n1,n2,kg,other);
return 0;
Loading…
Cancel
Save