0 like 0 dislike
請撰寫一個程式,使用者會輸入一行字元,換行字元代表輸入結束,請計算所有的輸入當中有多少個英文字母,多少個數字,以及多少個其他的字元,並依照範例的格數輸出。

Sampile input:

[email protected]#$%^&*()_+

Sample output:

digit:10
alphabet:26
other:13
[Exercise] Coding (C) - asked in 作業 by (18k points)
Available when: Unlimited - Due to: Unlimited

recategorized by | 375 views
0 0
Called for Help

65 Answers

0 like 0 dislike
Hidden content!
#include <stdio.h>

#include *** ****

#include <ctype.h>



int main()

{
** * * * *** * * * c;
* *** * ** * ** * * x = 0,y = 0,z = 0;
** * * * * *** *** ** **** ***** * **** &c);
** **** * * ** **** * != '\n')
* ** * *** ******
*** **** ** * * * ** * * ***** * * **** **
*** * ** ********* ** * * * **** * * * * *** **** = x+1;
**** * **** **** * * **** ***** ** * if(isalpha(c))
* * ** *** * *** * **** ***** **** **** ** ** * * * = y+1;
*** * * * **** * * *** ** ****
** * ** * *** * ** ** ** * ** *** * * * * = z+1;
** * * *** ** ** *** * **** * *** ****** * ** ** &c);
* * **** **** *
** ****** *** * *** * ** * *** *** * ** * * * x, y, z);


****** *** *** ** **** 0;

}
answered by (-188 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include *** **** * ** *

#include * * * * **



int main()

{
* * ** **** * * * c;
** *** ** *** * * x = 0,y = 0,z = 0;
* * **** ** ** ** ** *** * * * &c);
****** * *** * * * ** ** != '\n')
* *** * * ** * * ****
* * **** ** ** * * * * * ** ****
** * * ***** ** * * ** * *** ** ***** * = x+1;
** ** * * ** * * * * * ** * * * if(isalpha(c))
*** ** **** * ** ** ** *** *** * * *** ** = y+1;
** * * * * ** * * ** * *** * **** **
*** ** *** ******** * **** **** * *** ** * **** * *** = z+1;
* *** **** ** *** * ***** * * **** * * *** * ** * &c);
*** ** ** *** *******
** ***** * *** ** * *** * ** ** %d %d", x, y, z);


****** *** * **** ** 0;

}
answered by (-188 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include * *** **

#include <ctype.h>



int main()

{
* ** * ******* * c;
** * * *** * ** x = 0,y = 0,z = 0;
** ** *** * ** * * **** ** &c);
***** * * * != '\n')
* **** ** * **
* * * * **** * ** ** * **** *** * ** ** ** *
** ** *** * * * *** *** ** ****** * * ** *** * = x+1;
*** ** * ** *** * * ******** ** ** if(isalpha(c))
**** ** * * * * * * ** * * ** *** * ****** *** = y+1;
*** *** * ** * * * * * *** * * *
**** ** ** ** * *** * * *** *** ** * ** * * ** * = z+1;
* * * ** * * * **** * * ** * * &c);
** ** * ***** *
* * * *** ** ** ** **** * * * **** x, y, z);


* * *** * ** ** * * ** 0;

}
answered by (-188 points)
0 like 0 dislike
Hidden content!
* * * * * *** **
** ** * * *** *
* ** * ***** ****

int main()



{
* *** * ***** ** ** c;
* *** * * ** * * a=0, b=0, d=0;

   
* * ** ** *** * * * ** ** **** * * * &c);

   
**** ** * ********* * * != '\n')
*** * *** * * *
* **** * **** * *** * * *** *** *** ***
* ** **** * (isdigit(c))
** ** ***** * ** **

   
** * * ****** * if(isalpha(c))
* *** * ** ** ** *
** **** * * ****
** * **** * ***
** ** * ** * ** *
* *** ** *** * *
* * * * * * * *** ** *** * &c);
* ** * ** ****
* * *** **
*** **** * ** ** ** * *** *** a);
** * ** * *** * * * * **** * * * ** * b);
** *** ***** **** *** * * *** d);
* *** * * ** *****
**** ** *** * **
* *** * * *** * *
* * *** * * * * * * ** 0;

}
answered by (-110 points)
0 like 0 dislike
Hidden content!
* ** *** * ** *****
* *** ** * *
** ****** * * * **

int main()



{
***** * * **** * c;
*** ** * ** ** a=0, b=0, d=0;
* *** *** ***
* * * * * ** ** * * * ** ** * ** * &c);

   
*** * *** * * != '\n')
* ** * ***** *
* ** * ** *** * * * * * * ** *
*** ******* * (isdigit(c))
** ** ** * **** *

   
* * * * * * if(isalpha(c))
** * ** ** * ****
****** *** * *
* *** ** ** * *
* ** *** * * **
* ** * ** * * **
** * * * **** * *** * *** * &c);
****** **** * * **
* * * * **
* * *** ** * *** **** ** %d\n", a);
* ** * ** ** * * **** ** *** * %d\n", b);
*** ** ** *** * * ** * * * %d\n", d);
* ** *** ** *** *
** ****** * ***
** *** ** * *******
*** * * ** * * * * 0;

}
answered by (-110 points)
0 like 0 dislike
Hidden content!
*** * * * *
* * *** * * *
* * * ** *** * *

int main ( * * *
** ****
** *** c ;
* * ** ** *

scanf ( * **** **** * *
** ** * (c !='\n') *** ** *



if ( isalpha (c))
* *

x=x+1;
** *****

else if ( * (c)){
*** ** ** * ** * *** ** ** * ***** ****** * * *

}

else {
*** ** * **
***

scanf ( ** * *** * * *
* *
* ** ** ( * ***** * *** ** *
* *** * * ( *** * ** * **** ,x);

printf ( * *** * * * **** *
* * ** ** ** * * ***
* * ** 0;

}
answered by (-304 points)
0 like 0 dislike
Hidden content!
* * * ** * * * ***
* * * * ** ** *** *
** * ****** **** ***

int main ( * *** *
***** *
* ** c ;
* **** ** * *** ** *

scanf ( * * * ** * **** **
* ** (c !='\n') ** **



if ( isalpha (c))
* **

x=x+1;
* *

else if ( * (c)){
* ** * *** * * *** * ** * * ***** **** *

}

else {
** * *


scanf ( * ** * ** ** ** **
* * **
* * ** ( *** ***** * ** ** **
* * * * ( ** ** *** ***** * * ** ,x);

printf ( ** *** **********
**** * *** * *** * *
** * ** * 0;

}
answered by (-304 points)
0 like 0 dislike
Hidden content!
* **** * *
** ** * ***** **
* * * **** ** * **

int main()



{
** * *** ** * ** *** * c;
* * ********* ** a=0, b=0, d=0;
**** ** **** ** * * **
***** * ** *** ** *** * *** * ** &c);
** * * **** *
**** * * * *** * ***** != '\n')
* * * * ** ** *
* **** * * * * ** * * ** * ** ** *
* **** * * * ** * * * (isdigit(c))
** ** ** ** *

   
* ***** ** ** * **** if(isalpha(c))
*** * ** ** **
*** * ** **** * *
* * ** ***** **
** **** *** * ** ***
** **** * * ***
* **** *** * ***** * * ** * * * * &c);
** *** * *
* ** * ** * * *
***** * * *** *** * * ** * **** ** %d\n", a);
******* ** * ** * * %d\n", b);
*** ** * * * * * *** ** *** *** %d\n", d);
** * ** **** * *
** ** * * **
* **** * *** * ("pause");
*** * *** * * * * 0;

}
answered by (-110 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>

#include<ctype.h>

int main()

{

    int a=0,b=0,i=-1;
*** *** ** * * * ** ** c;
* ** * *********** *** * * (c!='\n')

    {
** * * * * ** ** * * * ** **** ** * ** * * *
*** ** *** ** * * * * ** *** * * * * * *** * * * *
** * ** *** * * * **** * ** * ** * *

******* * *** * ** ** * * * ** *** * (isalpha(c))
* ** * *** * *** * * * **** * *** * * * ******
** ** ** ** * * * * ** *

* ** ** ** * ** ** * * ** **** * * * ** * * * **
* ** * * *** * ***** * ** *** * ** **** ** *** **
* * ** * ** ***** * * *   
* ** * * * ******** * *** ** *** **** ** * *
* * ****** **** * * * * ** ** ****  
*** *** ** *** ** **** * *** * * *** * **** * ***
*** *** ** * ******* *** **** * * * **
** * * *** ** * * * ** 0;

}
answered by (-188 points)
0 like 0 dislike
Hidden content!
*** ** * **
** ******* *** *** * *
* **** *** ** * *

int main (  )
* * *
**** **** c ;
** * ** *** * * ******


* * * (c !='\n')  {
* * ** * * **** ** * * * ** * **** ** * **** * * ( ** * * ** * * **** *

if ( isalpha (c))
**** * *

x=x+1;
* * *

else if ( isdigit (c)){
* * * * * * * *** * ** * * * * ** ***

}

else * * ***
***** ** *
** * * *
*** *
**** **** ( ** * * ** *
* * ( **** **** ** ,x);

printf ( ** *** ******* ** *
* **** *** ** ** ** *** *
* * *** ** * 0;

}
answered by (-304 points)
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:173.245.54.37
©2016-2020

Related questions

0 like 0 dislike
23 answers
[Exercise] Essay (Open question) - asked Dec 22, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 167 views
0 like 0 dislike
20 answers
[Exercise] Essay (Open question) - asked Nov 10, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 199 views
0 like 0 dislike
7 answers
[Exercise] Essay (Open question) - asked Dec 22, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 102 views
0 like 0 dislike
26 answers
[Exercise] Coding (C) - asked Nov 3, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 199 views
0 like 0 dislike
37 answers
[Exercise] Coding (C) - asked Oct 20, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 196 views
10,964 questions
126,603 answers
124,036 comments
3,820 users