Toggle navigation
Courses
Questions
Tags
Users
AC 20161123 exercise 1
0
like
0
dislike
5.7k
views
請撰寫一個程式,使用者會輸入一行字元,換行字元代表輸入結束,請計算所有的輸入當中有多少個英文字母,多少個數字,以及多少個其他的字元,並依照範例的格數輸出。
Sampile input:
1234567890ancdefghijklmnopqrstuvwxyz~!@#$%^&*()_+
Sample output:
digit:10
alphabet:26
other:13
[Exercise]
Coding (C)
-
asked
Nov 23, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 17578 -
Available when:
Unlimited
-
Due to:
Unlimited
|
5.7k
views
comment
1
3
Called for Help
Please
log in
or
register
to add a comment.
82
Answers
0
like
0
dislike
Hidden content!
#include<stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
int check1(char c)
{
**** *** * *** ** * ** * i=0;
* * ** ** * * ** * * *
* * * ** * * *** ***** * ** * ** *** ** * *
return i;
}
int check2(char c)
{
** ** * * * * * ** ** * * j=0;
*** ** ** * ** * **** ***
*** * ** * * * * * ** * * ** * **
else if(isdigit(c))
** ****** ** * * ** * * * * **** ** * *** * **
return j;
}
int check3(char c)
{
**** ** * * * * t=0;
** * * ** * * *** * * *** ** * *
* * ** * * ** ** * *** *** * * ** ** ****
* * ** ** * ** * * * if(isdigit(c))
** *** * * ***** * * ** * ** * * *
* **** ***** ** * ***** * *
* **** * *** ** *** * * * ** * * *** **
return t;
}
int main()
{
** * *** * **** * ** * ** c;
*** ***** ** ** * * * ** i=0,j=0,t=0;
** * * *** * * *** * **** * * * **** ** *
*** * ** * *** ** * * *****
* * *** * * * *** * *
**** ***** * ** * * **** ** ** ** * *** ** * * ****** *****
* ** * * ** * **** * *** * ***** *** *
* * ** *** * * ** * * ** * ***** * **** * * * *
* ** * ***** ** ** * * ******** *** ** * ** ** * ** *
* ** ** * * * * **** * *** **** * * *** *** ** *** * * **** ** **** * *
}
*** * ** *** ** * **** * ** * ** ** ** ** * * * * **** *
* * *** ** ** *** 0;
}
answered
Nov 30, 2016
by
羅祖嘉
(
-248
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
int main(void)
{
* * ** * **** * *** * *** * c;
int m=0;
int n=0;
int i=0;
** * ** * * **** * ** ** **
* ** * * ** * **** **** ** **
{
**** ****** * * ** ** ** * * * * ** ***** * * * ** * ** * ** * ** * * * * ** * * * **
* * * ** ** * * ** ** * ** ** ** * * ** * * ** ** * * * *
** * ** ** * ****** * * * ** * * * * * * * * ** * **** ** *
**** *** ** ** ** *** * * * ***** * ** *** *** * ** * *** *** ** * *
** * * ** * *** * * * ***** ** * * ** * * ** *
** *** * * * * ** * * ** * *** ** * * **** * *** *** ***
** ** * ** ** * * * ***** * * * ** ** * ** * * **
* * ***** ** ****** *** ****
* * * * * * * ** ** ** * ** * *** * * ** * ** * * **
* * * * ** * * * ** 0;
}
answered
Nov 30, 2016
by
陳孜由
(
-98
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
# include <stdio.h>
# include * ** ** *
int i,j,k;
void check (char c);
int main ()
{
* * *** *** * c;
**** * * * * ** *
**** *** * * * * * **
*** **** * *** *
** * ** * * * ***** ( * *** * * **** );
* **** *** * * *** ( c!= '\n' )
***** * *** * ** ** *
* *** * ** * ** ** * (c);
**** ** * *** * * * ** * * ( ** *** * ** * ** );
* * * *** * **
* * ** ** ******** * * ** * ******* *
* * * ** ***** * * * * **** **** * *
* **** * *** * ** ** * **** * * ** **
** *** * *** ** * * 0;
}
void check (char c)
{
**** * ** * * (isdigit(c))
* *** * * ** *
* * *** **** (isalpha(c))
* *** * ****** *
* ** ** * * **** * (isspace(c))
* * ** **** *
** ** ** * *** (ispunct(c))
**
* * *** *** **** ** (iscntrl(c))
* * **** ** ***
** *** ** **** ;
}
answered
Nov 30, 2016
by
410425044
(
-114
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
# include ** * *
# include * ** * *** *
int i,j,k;
void check (char c);
int main ()
{
**** * * ** c;
* ** * * * **
* **** * ** * * **
* * ** * *** *
* * ** * * * * ( * **** ** ** * * * * ** );
* ** * ***** * * ** ( c!= '\n' )
* ** *
* * * * * ** ** ******** (c);
* * *** **** * * * * * ** ( ** *** * * ** ** );
** *** * * * **
* ***** ** * * ** * * * ** ** * * **
* * * * **** * ** ** * * * **** * * *****
* ****** * ** *** *** ** * * ***** *** * *
*** ** * *** * ** * **** 0;
}
void check (char c)
{
*** ** * * * *** ** * (isdigit(c))
********* * *******
* * ** ** ** * * (isalpha(c))
***** *** * * ******* **
* * * * * * **** (isspace(c))
** * *** ** ** **
* ** * ** * ** ** (ispunct(c))
** ** * * * * *
** *** ** * ** * * (iscntrl(c))
**** ** * * * ** ****
** * * ** * *
* *** *** ** ** *** *** ;
*** ** * *** * *
}
answered
Nov 30, 2016
by
410425044
(
-114
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include <ctype.h>
int check(char c)
{
int i;
i=0;
** * * * * *** * ***** **
* *** * ***** **** ** ** ** * *** **** **
* ** * * * ** * ** i;
}
int check2(char c)
{
int j;
****** * * ** **** ****
* *** * *** * * * * * *
* * ** *** * * * * * * ****** * * * ** *
* * **** *** * *** * j;
}
int main ( void )
{
* * *** * ** * * ** c ;
int l,j,i;
* * * * * ** **** ** * ** ** **** ****
** * *** **** * ** * ** *
** ***** * * ** * * * **
* * * * ** ** ******
* *** ** ** ***** ** * != '\n')
{
** *** ** ** * *** * * * ** ** ** * * ** ** ***
* * ** * * ****** * ** *** ** * * ** **
** ** ** ** *** * ***** ** * ***** * **** * *
* ** * *** *** *** * * * * **** *** * * *** * * ** * * ** ******* *
* * ** * ** *** * *** * * * **** * ***** ** * ** * * **
* * *** * * ***** * * ****** * ***** ** * **** ******* * * ****
*** **** * * ** * * **** * **** *** ** * * * *** ** *** **
* ***** * ** ** ** ** * * * * * **** * *** *** ** * ** ** ** *
**** ** ** ** * ** * * ** * * * *** * * ** *
}
**** ** ** * * * ** * ** ** * * * **
* * * ** * ** * ** *** * ** * *** * ** **** **
*** * * * **** *** * * ** *** ***
* *** * * * *** ** **** ** 0;
}
answered
Nov 30, 2016
by
410211222
(
-186
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
void judge(char c[500])
{
** **** **** * *** ** *** * a1=0,a2=0,a3=0,in;
* ********* * * ** * * * * **** ** && c[in];in++)
{
*** ***** ***** * ** ** ********** *** ** * * * (48<=c[in] && c[in]<=57)
** * ** * ** ** ** * ** * * **** ** ****
* *** * ***** * ** * * * * ** * * *** * * * *** * ** ** * ** *
* * ******* * ** * ** * * ** * * * *** ** * ******
** ** ***** * * ** * * ** ** * ** ** if(65<=c[in] && c[in]<=90)
*** ** * * * * ** ** ***** * * * ** * ***
* *** * ** ** ** * ** ****** ** ****** * * ****** *** * **** *
* ** * * **** * * * **** * ** * * * * ** **
**** ** ****** * ** * * ** * ** ** if (97<=c[in] && c[in]<=122)
** * * ** * * *** *** * ** *** * **
* ** *** * *** * * *** ** * ***** * * * * * ** *** * * *** * *
* * * ** * ** **** ******** * ** ****** *******
****** ** ** **** * *** * ** * **** * ** * *** ***
* ** ** ***** * ** *** ** *** * *** *
* ** * * * * * *** ** ** * *** ** * *** ** * * * * * ***** * * ** ***
** * * * ** ** **** ** * ******** * * **** *** * *
** * * *** * *** **
***** ******* * * ****** *** * ** ***** *
* * ** ** * ** * * * *** ** *** * * * * **
** * *** ** ***** ** * * *** * *** * * * *
}
int main()
{
***** * * *** * ** **** c[500];
********* * * * ** * *
** ** ** **** * * ** * * *
* * * ** *** ** ** ** 0;
}
answered
Nov 29, 2016
by
林佳慧
(
-85
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
void judge(char c[500])
{
** * * * ** * * * ** a1=0,a2=0,a3=0,in;
* ***** * *** **** * *** * * && c[in];in++)
{
* *** * ***** ** **** * ** ** ** *** * ** (48<=c[in] && c[in]<=57)
****** ** *** * *** * *** ** ** * ** *** ***
** *** * ** * *** * * ** * * * *** * * * * ***** * * * **
***** * * ** *** ** * ** *** * * * * **
* * ** * * * * *** * * * * ****** *** *** * ** if(65<=c[in] && c[in]<=90)
** * ** **** ** * * * * * *****
* * ** **** ** **** * *** * *** * * **** * * * ** * * * ** ** * ** *
* *** ** * ** ********* * **** ** *** * *** *
** * *** ** *** ** **** **** * ** * * **** if (97<=c[in] && c[in]<=122)
* * ****** * *** * ** * **** ** ** ** *** *
* * ** *** ** ** ***** * *** ** **** * ** ** * ** ***** * * * * *
** * * *** * ** * ** **** ** * * ******** *
************ * *** * ** * * *** ** ******
** * * * * * * *** ** *** **** *** *
* * * * ** * ** ** ** * *** * ***** * * *** * * *** * ******
*** * ***** ** ** ** * * ** ** *** * ****
** * * ** ** * ** ** ** **
**** * * *** * ** * * ****** ** * *** * ** *** *
* *** * **** *** *** **** * *** ***** * * *** * * ** *
* * * * **** ** * * *** *** * ** * *****
}
int main()
{
*** * * ***** *** * c[500];
*** * * * * * *** *** *
** * * ** * * **
* ** ** * ** *** * ** ** 0;
}
answered
Nov 27, 2016
by
威
(
-124
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
void judge(char c[500])
{
*** ** * ** *** ** *** a1=0,a2=0,a3=0,in;
* * *** ** *** * * *** ** * && c[in];in++)
{
* *** * * * *** **** ********* * * ****** * * (48<=c[in] && c[in]<=57)
* * * * * * * *** *** * * * *** ** *
* *** **** ** * * ****** *** * *** * * ** * * ***** * ** ******
* **** ** * **** * ** * ** ** ******* *** * ** * *
* * *** * *** ** * ** ***** * *** ** * if(65<=c[in] && c[in]<=90)
* * ******* * * ** ** ** * * * * * * *******
* * ** ** ** * * * ** ******** * ** * *** * ***** * ** ****
* *** ***** * **** *** ****** * * ****** * *** **
* **** *** *** **** * * * * * ** ** * * * if (97<=c[in] && c[in]<=122)
* * * * **** ** * * **** * ** * ****** * *
* * ** * * * ** ***** * * ** **** * * * * * * ** * * ** **
** ****** **** * ** * ***** ** * * * *** ***
** ** ** * * *** ****** ** * ** ** * *
* ****** * ** ** ** ** *** **** *** ** *
* **** *** ** * ** * ** * ** * * ** * * * *** * ** * ** * ****** * *
***** * *** ******** **** * * * * * ** **** ** * **
* *** * **** *
* * **** **** * * * ***** ** * ** **
* ******** ** ** * **** ** ** * **** **
* * *** *** *** * ******* *** ** ** **** * ***
}
int main()
{
* **** ** * * *** ** * ** c[500];
* ** *** * *** * ** * ** *** ** * ** ***
* ******* ** *** * * ***
**** *** * * **** *** 0;
}
answered
Nov 27, 2016
by
威
(
-124
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
*** * * *** * * *
int main(){
* ** ** ** **** digit = 0, alphabet = 0, other = 0;
*** ** ** * * * c;
******* ***** * * * ** * * ** &c);
* ***** * * ** * *** * * * != '\n'){
*** ** * * ** * * ** * ****** ** ** * * ** * **
*** ** ** * ** ** * *** * ** * **
* *** * ** * * ** ** * * * *** * if(isalpha(c))
* * ** ** ***** *** * *** * * ****** *** ****** ** *
*** * * ** * ** **** ***
* ***** ** ****** * ** * * ***** * * ******** *
* *** * ** ** ** ** ** ****** * * ** ***** &c);
}
* * ** * *** * * **** * ** ** ** **** ** digit);
* * * ** * ** ** **** ***** ** * * alphabet);
* **** * * * * *** ** * *** * other);
return 0;
}
answered
Nov 27, 2016
by
410342026
(
-105
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include * ** * ** *** **
#include * * ** **
#include **** * ***** *
int main(void)
{
int a=0,b=0,d=0;
** * ** ** * **** ** ** * c;
*** ** *** ** **** * * *** * * ** * ** * *
** * * ***** *** * * * (c!='\n')
{
* *** * * **** **
* *** * ** ** * **
** * *** * **** * *** * (isdigit(c))
**** ** * * ** **** * * * *** * *** ** * * = a+1;
* * * * * * ** * * ** * ** if (isalpha(c))
*** ****** * ** *** * **** *** * * * ***** * ** * = b+1;
** * * * * * ** ** ** *
**** * * * * * * = d+1;
* * * * * ** ** * ** **** *** ** *****
** * ***
}
* * ** * **** * * ** * ** * **** ***** *** * ****
* ** * ** * ** **** *** * ** * * ** * *
*** ** * **** *** ** * ** * ** *** ***** * **
* * ** ** * ** * 0;
}
answered
Nov 24, 2016
by
410523016
(
-136
points)
ask related question
comment
Please
log in
or
register
to add a comment.
Page:
« prev
1
2
3
4
5
...
9
next »
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English
中文
Tiếng Việt
IP:172.70.127.115
©2016-2025
Related questions
0
like
0
dislike
0
answers
AC 20161228 exercise 1
[Exercise]
Essay (Open question)
-
asked
Dec 28, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 20139 -
Available when:
Unlimited
-
Due to:
Unlimited
|
401
views
0
like
0
dislike
20
answers
AC 20161221 exercise 1
[Exercise]
Essay (Open question)
-
asked
Dec 21, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 19748 -
Available when:
Unlimited
-
Due to:
Unlimited
|
1.9k
views
0
like
0
dislike
26
answers
AC 20161109 exercise 1
[Exercise]
Essay (Open question)
-
asked
Nov 9, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 17203 -
Available when:
Unlimited
-
Due to:
Unlimited
|
2.5k
views
0
like
0
dislike
0
answers
AC 20161228 exercise 2
[Exercise]
Essay (Open question)
-
asked
Dec 28, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 20140 -
Available when:
Unlimited
-
Due to:
Unlimited
|
434
views
0
like
0
dislike
3
answers
AC 20161221 exercise 3
[Exercise]
Essay (Open question)
-
asked
Dec 21, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 19755 -
Available when:
Unlimited
-
Due to:
Unlimited
|
615
views
12,783
questions
183,442
answers
172,219
comments
4,824
users