1
#include <stdio.h>
2
#include <string.h>
3
int main()
4

{
5
char strInput[255];
6
int i=0;
7
int nLength,nABC,nNum;
8
nLength=0;nABC=0;nNum=0;
9
scanf("%s",strInput);
10
nLength=strlen(strInput);
11
printf("所有字符數:%d\n",nLength);
12
do
13
{
14
char sTemp=strInput[i];
15
if (sTemp>=48 && sTemp<=57)
16
nNum++;
17
if ((sTemp>=65 && sTemp<=90) || (sTemp>=97 && sTemp<=122))
18
nABC++;
19
i++;
20
} while (i<nLength);
21
printf("字母數:%d\n",nABC);
22
printf("數字數:%d\n",nNum);
23
return 0;
24
}

2

3

4



5

6

7

8

9

10

11

12

13



14

15

16

17

18

19

20

21

22

23

24
