4 like 0 dislike

輸入5個英文字母,判斷大小寫。

大寫為數字2,小寫為數字1。

將得出的數字加總:

input:
abcde

output:
5

input:
ABCDE

output:
10

 

[Normal] Coding (C) - asked in 程式設計(一) by (11.3k points)
Available when: Unlimited - Due to: Unlimited

retagged by | 156 views

4 Answers

0 like 0 dislike
Hidden content!
** * **** * *
* *** * ****
int main()
{
* * ******* char arr[5];
* *   ** * *** *** * **
* *** *** {
* ** * ** ** * ** int * *
* ** ** * ** ** * * * * * * * * ** *
** ** * * * * * {
* ** ** *     ** * * *** ******* * ***** * * ****** *
* **   * * * * ** ** ** count++;
** *** * * *** ***** **** * * ** * else
** ** * * * * * * ** *** **** count+=2;
* * * ** * ** * * * }
* ** * ** ***** ** ****** ** **** **
* * **** * }
* ** * return 0;
}
answered by (100 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
* *** * ** *****
*** ** * * ***

int main(int argc, char const *argv[])
{
* *** * ***** char str[6];
* * ** ***** int i,sum=0;
* ** ** * * *
*** ** ** ** * *** *** * **
**** * * {
** ** *** * ** * * * * * ** * * * * **** *
**** *** * ** * * * ***** * ** ** * *** sum+=2;
* * * * * ** * * else ** * ** ** *** * * * **** * *
*** * ** * ** * ** ** *** * ** sum+=1;
****** ** }
* * * * * * ** **** * *** * *

* * * * * ** return 0;
}
answered by (120 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include * * *
** * * * ** * * ** *

int main(int argc, char const *argv[])
{
** ** ***** char str[6];
* *** * ** int i,sum=0;
* * ** * * * ** ** ****
*** ***** * ** * * * ****
* ** ** * * * ** *******
* * * ** {
* * * * * * * * ** * ** * *** **** ** * *** *** *
*** * ** * * * *** * * *** *** ** sum+=2;
**** **** * * * * ** else * ** ** *** ******** *
* * ** * *** ** ** ***** ** * sum+=1;
** * *** * }
* * * ** * * **** * * **

* * *** * ** * return 0;
}
answered by (120 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
0 like 0 dislike
Hidden content!
#include * * * *** * *
#include *** ** ** **

int main(int argc, char const *argv[])
{
*** * * **** char *
*** * ** ** int i,sum=0;
** ** * * * **** *** ** *
* *** ***** * * ** ***** **
* * *** *** ** *** ***
*** * ** {
** ** * * * * *** * *** ** * * * * * *
**** * * * * * ** * *** * ** ** * * sum+=2;
* ** * *** * * * * ** **** else * * ** * ** * * * * * ****** **
*** * ** * **** * * * * ** sum+=1;
* * **   ** ** else
* *** **** ** ** * *** * ** **** *** ** ** *** * *** ***
* * * * ** }
***** ** ** ** * ** ** * * *******

** * *** return 0;
}
answered by (120 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.63.73
©2016-2020

Related questions

4 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 3, 2018 in 程式設計(一)
Available when: Unlimited - Due to: Unlimited
| 253 views
10,155 questions
107,062 answers
92,558 comments
3,252 users