4 like 0 dislike
1.4k views

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

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

將得出的數字加總:

input:
abcde

output:
5

input:
ABCDE

output:
10

 

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

retagged by | 1.4k 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 (114 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 (114 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 (114 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
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.130.195
©2016-2025

Related questions

4 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 3, 2018 in 程式設計(一)
ID: 40624 - Available when: Unlimited - Due to: Unlimited
| 1.6k views
12,783 questions
183,442 answers
172,219 comments
4,824 users