Toggle navigation
Courses
Questions
Tags
Users
AD 20161124 exercise 1
0
like
0
dislike
1.3k
views
請撰寫一個程式,使用者會輸入一行字元,換行字元代表輸入結束,請計算所有的輸入當中有多少個英文字母,多少個數字,以及多少個其他的字元,並依照範例的格數輸出。
Sampile input:
1234567890ancdefghijklmnopqrstuvwxyz~!@#$%^&*()_+
Sample output:
digit:10
alphabet:26
other:13
[Exercise]
Coding (C)
-
asked
Nov 24, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 17667 -
Available when:
Unlimited
-
Due to:
Unlimited
recategorized
Nov 24, 2016
by
Shun-Po
|
1.3k
views
comment
0
0
Called for Help
Please
log in
or
register
to add a comment.
65
Answers
0
like
0
dislike
Hidden content!#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
int main(void)
{
int a=0,b=0,c=0;
char d;
** ** ** *** ** * * * * * * ** * * ***** * * *
* ** * * * * * ** *** *
* * * ** * **** * *** ** * **
* * * *** *** * **** ** * ***** * * ** * (isalnum(d))
** *** ** * **** * ** *** **** ** * * * * * ** * **** * ** * **
* ** * * * * ** * * * * * * * * ** (isalpha(d))
*** * * ** * * * * * ** ** ** * * * ** * * *** *
* * * * ** * * *** * **** * * * * * * (ispunct(d))
** * * ***** * * * * ** * *** * * * * * *** * ** * ** **** * *
* ** * ** * * * * * * * * ** * * ** * * * * * *
** **** * * * * ** * * * *** * *
* * *** * * *** ** * * * * * ** * * * * **
* ** ** * * *** * ** * * *** * *** *** * *
** * * * * * * * * * * * **** ** ****
return 0;
}
answered
Nov 24, 2016
by
laich
(
937
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!# include <stdio.h >
# include <stdlib.h >
# include <ctype.h >
int main ()
{
char c;
int a=0,o=0,n=0,h=0;
* * * *** * * * *** * * * * * * * * * * * ** * *
* * * * * ** * * * * * * * * * * * * * *** * *
* *** * * * * *** * * ** ** * * * * *
* * ** ** *** **** * ** * * * * ** ***** * * ** ** *