2 like 0 dislike
6.2k views
請寫一個程式將輸入的小寫字母都轉成大寫字母

輸入說明:

會輸入一連串的字元,最後會用一個*作為結束

輸出說明:

請將輸入的所有小寫字元都轉成大寫字元輸出,如果不是小寫字元就不做任何輸出。

輸入範例;

1234567890ABCDEFGHIJKlmnopqrstuvwxyz*

輸出範例:

LMNOPQRSTUVWXYZ
[Exercise] Coding (C) - asked in 2017-1 程式設計(一)AD by (18k points)
ID: 31088 - Available when: Unlimited - Due to: Unlimited
| 6.2k views

31 Answers

0 like 0 dislike
Hidden content!
#include<stdio.h>
int main()
{
    char c;
** ** * * ** * * **
*** * ** * *** * * * **** **
    {
* ** * * ** ** * * * ** * * * *** ** * * * * **** * ** * **
* * ** * * ******** *** ****** ** **** * ******* ** **
* *** * * ** * ***** *** * * * * **** *
*** *** ** * * ** * * * * ************ * *** * * * * * ** *** ** ***
**** **** * ** ** * * * *** ** ** **** *** *** * * **** * * **** ** * ** * *** * * **
** *** * * ** *** * * *** ** * * * * *** * ***** **** *** ** * * ** * ** * *
** ** * ** **** * * ** *** ** **** * ***** * *
* * *** ** ***** * * * * *** * ** *********
    }
***** ** ** * * * * ** ** * ***** **** * ** **
    return 0;
}
answered by (100 points)
0 0
prog.c: In function 'main':
prog.c:9:15: warning: implicit declaration of function 'islower' [-Wimplicit-function-declaration]
         while(islower(c))
               ^~~~~~~
prog.c:12:25: warning: implicit declaration of function 'toupper' [-Wimplicit-function-declaration]
             printf("%c",toupper(c));
                         ^~~~~~~
prog.c:17:5: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
     system("pause");
     ^~~~~~
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main()
{
* *** **** ******** a[100]={0};
********** *** * ** j;
* * * ** ** * ** * * * * * * ** *
    {
******* ** * **** *** * **** ** ** * * ** * **** * * *** * * ** * ** *** **
* * **** ** * * * * * * * ** ** *** ** *
* ** * *** * * * ** ** ** *** ** * * *** * **** ** *** **** * ***** *** *** * * *
* * *** * * ** ** * *** * ** * * ** ** * ** ** * ** * * * * * * *** * * * ** ** *** ** *** * *** ** * ******* *
*** *** ** ** ** *** **** *** *** ** * * *
    }

******** ** * ******* ** 0;
}
answered by (114 points)
0 0
Case 0: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main()
{
** * * * * * * * ** * a[100]={0};
**** *** * * ** * * * *** j;
* * *** ******** ** ** * ** ** *** * * ****
    {
* **** * *** * *** * ** * *** * * * *** * * ***** * * * **
* * ** ** ** ** *** **** * * ** ** *** * *
*** * **** * **** * * * ** ** ** ** * * * * **** * * *** * ** * * * * ** ** * * **** * ** *
** ** * *** * * * *** * * ** * * * *** *** **** *** * * * ** *** *** ** * ** * ** **** ** ****
* ** ** * ** ***** * * * *** ** *** * ** **
** *** ** *** *** * ** * **** *** * * ** * * ** * * * ** ***

    }

** ** * * ** *** * ** ** 0;
}
answered by (114 points)
0 0
Case 0: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main(void)
{
** ** *** *** ** * * c;
  
* * ** ** * * **
* ** ** *** * * * * * * *
* ** * ****** * * *
*** * ** * * * * * *** * * **** **** **** * * ** *
*** * * * * **** * ** * * ****** * ** ***** ****** ** * ** * ** * *
* ***** *** * ***** ** ** * ** ****** *** ***** * *
***** * * *** ** *
    
** ** * * ** * * * * ** * 0;
* * **** ** ** ** * **** *
answered by (215 points)
0 0
Case 0: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main(void)
{
* *** * * ****** *** c;
** ***** * ****** **** *** * * *
** * * * * * * *** ***
* * * *** * * * ****
* * ***** ** * *** * ** *
* * *** *** *** *** * * * *   * * **** *
* * ****** *** ***   * ** ** ** * * **
** *** * * * ********* * ** ***   c=getchar();
    }
* * ** ** ** ** *
*** * * * **** * * *** ** ** ** ****
****** ********* ** * * *** 0;
** **** **** ** * * * *
answered by (215 points)
0 0
prog.c: In function 'main':
prog.c:14:5: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
     system("pause");
     ^~~~~~
0 like 0 dislike
Hidden content!
* *** * * *

int * *** ***
{
*** *** ** int ch;
* ** * ** * ** * * ** * * *
* * *** * * * ** ch = *** * *
* * ** ** while( ch != '*')
* ** ** {
* * ***** *** * *** * if(ch <= 122 **** ***** ch >= 97)
* **** * ** **** * * ** ** ** ***** * * * * **** ***
** ** * * * * * * * ***** *
**** ** * * * * ** ** *** *
** ** }
* ** ****
****** * ** * * * * ***
* * * *** return 0;
* **
answered by (160 points)
0 0
prog.c: In function 'main':
prog.c:16:2: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
  system("pause");
  ^~~~~~
0 like 0 dislike
Hidden content!
**** * * *** * * *
int main()
{
*** ** * ** int ch;
* ** * ** * *** * * * *** * ** **
** ** * ** ch = ** **
*** * * * while( ch != '*')
** *** {
* ** **** * * * ** * if(ch **** 122 * * * * ch * * * 97)
** ** *** ** ** ***** * ** * * * ***** **
* **** * ** * * ** * ***** * ch = ** **
*** * **** * }
** ** * * * ** ** **** * * * ****
** * * * ** return 0;
* * ** * *
answered by (190 points)
0 0
prog.c: In function 'main':
prog.c:13:2: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
  system("pause");
  ^~~~~~
0 like 0 dislike
Hidden content!
#include * * * * * * *
int main()
{
** * ** ** int ch;
**** ** *** * * * * *** ***** * * **
** *** * ** *****
* ** * * * while(ch !='*')
** * ** * * {
* * * * * * * *** * *** *** *** & * ** *
** * * * * ** * * * * ****** * * * * ** **
* * ** ***** ****** * * ****
* ** * *** **** * *** **** ** * *
* ** ** * * }
* **** * *** *** * return 0;
}
* *
answered by (196 points)
0 0
Case 0: Wrong output
0 like 0 dislike
Hidden content!
* *** * * *** *

main()
**** **** ** * * * * *
char c[1000];
int i,n=0;

for( i=0; i<1000 ; i++)
{
* * ** * ** * * *** ** * ** * * * ** *****
****** * *
* **** *** * *** * * * *******
* **** * * ** ** * * * **** * ** ***** * ***
}

for( i=0; i<n; i++)
{
** ** * ** **** * * ** **** ** * * * * * ** *
{
* ** * * * **** ** * ** ** ** * * * * * * ** * *
}
* * ****** * * *** * ***
* * ** **** * * *** * * ** * **
}

* * * * ** ** ** **


 
* * * 0;


}
answered by (174 points)
edited by
0 0
prog.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main()
 ^~~~
0 0
prog.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main()
 ^~~~
0 like 0 dislike
Hidden content!
#include *** *** * ** ***
int main(void)
{
* * * ** * ch;
** ** * * * * * ****** * charcters: *****
** * * ** ** * ** = **
****** * ** ** ****** **** ch != '*')
* ** ** * *** * *****
* * * * * * * * *** ** ** <= 122 & ch >= 97)
* * ** *** ** ** **** * * **** ** *** ***
** * * * *** * *
*** *** ** ** * ** ** = getchar();
* *** * * *******
*** ******** * *** 0;
}
answered by (209 points)
0 0
Case 0: Wrong output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.127.53
©2016-2025

Related questions

2 like 0 dislike
29 answers
[Exercise] Coding (C) - asked Nov 9, 2017 in 2017-1 程式設計(一)AD by Shun-Po (18k points)
ID: 31094 - Available when: Unlimited - Due to: Unlimited
| 5.8k views
2 like 0 dislike
23 answers
[Exercise] Coding (C) - asked Nov 9, 2017 in 2017-1 程式設計(一)AD by Shun-Po (18k points)
ID: 31085 - Available when: Unlimited - Due to: Unlimited
| 4.1k views
3 like 0 dislike
9 answers
[Exercise] True/False - asked Nov 16, 2017 in 2017-1 程式設計(一)AD by 楊修俊 (30k points)
ID: 33764 - Available when: 2017-11-16 14:00 - Due to: 2017-11-16 14:30
| 962 views
3 like 0 dislike
9 answers
[Exercise] True/False - asked Nov 16, 2017 in 2017-1 程式設計(一)AD by 楊修俊 (30k points)
ID: 33763 - Available when: 2017-11-16 14:00 - Due to: 2017-11-16 14:30
| 890 views
3 like 0 dislike
6 answers
[Exercise] Coding (C) - asked Nov 30, 2017 in 2017-1 程式設計(一)AD by Shun-Po (18k points)
ID: 34979 - Available when: Unlimited - Due to: Unlimited
| 1.5k views
12,783 questions
183,442 answers
172,219 comments
4,824 users