0 喜歡 0 不喜歡
2.4k 瀏覽

Write a program that reads strings of up to 1000 characters continuously and displays them, after replacing the lower letters with upper letters and vice versa.

寫一個程式 輸入一個字串(最多1000)  把小寫轉大寫大寫轉小寫

Example input:

With the rise in GLOBAL warming and increasing POLLUTION levels, it is becoming essential to find a viable alternative to the internal combustion engine petrol powered CAR.

Example output:

wITH THE RISE IN global WARMING AND INCREASING pollution LEVELS, IT IS BECOMING ESSENTIAL TO FIND A VIABLE ALTERNATIVE TO THE INTERNAL COMBUSTION ENGINE PETROL POWERED car.
[考試] 最新提問 分類:Final Exam |
ID: 43459 - 從幾時開始: 2018-01-20 09:00 - 到幾時結束: 無限制
| 2.4k 瀏覽

12 個回答

0 喜歡 0 不喜歡
內容已隱藏
#include * ******** **
#include ******** *** *

int main(){
* **** * * *** ** ** str[1000];
*** *** ** ** **** * * len,i;

** * * *** *** ** * *** *
* * **** * ** * ** * = strlen(str);

** ** * * * * ** **** * * ****
* * * ** * ******* **** **** *** ** * * ** * ** * * >= 'a' && str[i] <= 'z')
**** * ** * ** ** * *** * ** **** ** * * * *** * * **** * *** ** * * ** * * = str[i]-32;
* **** * * ***** * * * * *** ** * * ***** if(str[i] >= 'A' *** * * str[i] <= 'Z')
** *** * * ** * * ** *** ** **** **** * ** *** ** * *** *** *** * * = str[i]+32;
* * ** *** **** ****

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

* * ***** *** ** 0;
** * * *
最新回答 用戶: (-74 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include * * * * * ****
#include * * * ** **** *

int main(){
**** * **** * * * ** str[1000];
** *** * * * * **** * * * * len,i;

* * * * ***** **** * * ****
** * * * **** * *** = strlen(str);

****** ***** * **** **** * ** * ***
****** * * ** *** * ** **** **** * ** *** ********* >= 'a' && str[i] <= 'z')
* * *** * * * * * *** ** * ** ** **** * * *** * ** * ** * = str[i]-32;
* * * * * * * * * **** * *** *** ** ****** if(str[i] >= 'A' * *** ** ** * str[i] <= 'Z')
* ** * ** * * * * ** * *** ** ****** * **** ** * ** * ** * ** * ****** *** = str[i]+32;
*** ** ***** * **

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

* *** * * *** 0;
***** * * ***
30/100 最新回答 用戶: (-74 分)
0 0
prog.c: In function 'main':
prog.c:8:5: warning: 'gets' is deprecated [-Wdeprecated-declarations]
     gets(str);
     ^~~~
In file included from prog.c:1:0:
/usr/include/stdio.h:640:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
/tmp/ccUxtyAl.o: In function `main':
prog.c:(.text+0x25): warning: the `gets' function is dangerous and should not be used.
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>
#include <string.h>
int main()
{
*** * ** ****** ** * * i=0,j=0,l;
** * ** * **** *** ** ** a[1000];
* * **** *** * * *** ***** *** *
** * *** * * *** ** * *
* ***** ** * *** ** * (a[i]!=0)
    {
* * * * *** * * *** ******* * * * * * * (a[i]=='\n')
** * ** ** * * * * ** ** *** * ** **
* ** *** ** *** ******* * * ** *********** * * * ** * **** ******* * * *
** ** * ** *** * *** *** ** ** * ** ** * ** ***** *
** **** ** ***** ** ** * * * * * * (a[i]>64 && a[i]<=91)
* ** * ** * *** * *** * ** ** * **
* *** * ** *** * *** ** * * * * **** * *** ** ***** **** ** * ***
*** ****** * *** * * *** * * * ***** * * *
*** ** *** * * * * * * * **** * ** ***** * if (a[i]>96 && a[i]<123)
** * * * * * * ******* * * *** * * * **
* * ** ** * ** * * * **** ** ** ** * * * ***** *** * *** *
*** ** ** ** * ** * ** ***** * ** * ** ** *
* * * **** ** * ** ** ** ** ** ***** * *** * ****
    }
** * * ** ** * * * ** ***** * * * ******* *
}
最新回答 用戶: (-229 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>
#include <string.h>
int main()
{
* * ** ********** * *** * i=0,j=0,l;
*** ** * ** * ***** * * a[1000];
** * ** ** ** ** * * * * *
*** **** **** * *** ** * *** **
* ** ** ** * ** ** * (a[i]!=0)
    {
** * * ** ** ** * * * * ** ** * ***** * *** *** (a[i]>64 && a[i]<=91)
** * ***** * *** **** ** ** * ** * * * ** * * *
* ** *** **** **** *** **** * ***** ** **** ** * *** ** * ** * * * *
* ** ** *** * ******* ** * **** ******* * ** *
** ** **** *** * ** ** *** * * *** * * * if (a[i]>96 && a[i]<123)
*** * * ********* * **** * * **** ** ** * ***
********** * * * * * *** * *** * **** ** ** * ** * * *****
** * ****** ** ** **** ** * ** ******** *** **
* *** ********* * ** ** ** * **** * * ** ** * * ** *
* * ** *** *** * **** *

*** **** *** * ******* * * * (l=0;l<j-1;l++)
**** * * **** * * ** *
**** ***** *** * ***** ** * ***** *** * * ** *** * *** ***** *
* * ** * ***** ***
}
最新回答 用戶: (-229 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char A[2000];

int i;

int main()
{
** ** ** ** * * ****** * *** * **

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

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

* * * * ** * *** ** * * * **** * ** ** * ** ******** * * && A[i]<=90){
** * **** ** ** *** * ** * ** ** * * ***** **** ** ** * **** ** *
* **** * * ***** ******* *** ** * * *** ** **** * ********* *** *
* *** ** * *** * ***** ** ***** * ** *** * **** * * * * tag;
** * * * ** *** ** * * * **** * ** ** *** *

*** ** * ** **** ** * ** ******* *** * ** * * ** && A[i]<=122){A[i]-=32;}

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

** ** *** * * * * ** * 0;
}
最新回答 用戶: (-286 分)
修改於 用戶:
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>
#include <string.h>
int main()
{
* *** ** * * ******** ** i=0,j=0,l;
* * ** * * * ** a[1000];
*** * * *** ****** *** ** * ** *
** ** * * **** **** * *
** **** * * *** * * (a[i]!='\0')
* ** **** ** ** **
** ** * * ** ** * **** **** * (a[i]>64 && a[i]<=91)
**** * ***** * * ** * ** ********** * ** * **** *
****** ** * *** * ** * * * **** * ** * * ** **** ** * ** *** ** *
** * * * * *** * ** * ** * * ** ** *
*** *** * * ***** * * * * * * * * **** * if (a[i]>96 && a[i]<123)
* ******* ** * * * * ** * *** **** ***
* * ********* * ** * ***** **** **** ** ** ** * ** ** *** ** * * *
* * * * ** *** * ** ** ** ** *** *** ****
* ** **** ****** * *** ***** * * ** * * *
*** * * ** * ** * **

** ** * * * ** * * *** * (l=0;l<j;l++)
    {
*** ********** * * *** ** * * ** ***** * ** ** * * ** * * *** *
* * * *** ** ** *
* ** **** ** * * * 0;

}
最新回答 用戶: (-229 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>
#include <string.h>
int main()
{
* ** ** ** ********** *** i=0,j=0,l;
* ***** ** *** * ** * a[1000];
** ** * * * * * * * * * **
** * ******* * * *** ** **** **
** * ******** * * * (a[i]!='\0')
*** * *** ** ***** * * *
** *** * * ** ** * * *** ** ** ***** (a[i]>='A' && a[i]<='Z')
* ** **** * ** * **** * * ******* *** * ** *
******* **** * * *** *** *** * * *** * **** * ** ****** * * ** ** **** **** *
** * ** * **** ** * ****** * * * ** ** * * * *
**** * *** * *** * ** * * *** * * * *** ** if (a[i]>='a' && a[i]<='z')
****** **** ** ** * * * * **** * * *
** ** * * * * * *** * * ******* *** * *** ** * **** ** ** *** * ** *
* * * ** * * * ** *** * * ** * ** * * **
* * * ** **** ** * * ** * * ***** * **
* ** **** * *** *

*** * * ***** * * **** (l=0;l<j;l++)
    {
** * ** ** ** * ********* ** * ** * * * ** ** * *** *** ** * *
** * * * * * ****
****** ** * * ** 0;

}
最新回答 用戶: (-229 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>
#include <string.h>
int main()
{
****** ** ** *** * * * * i=0,j=0,l;
* ** * * ** * *** ** * a[1000];
**** * **** ** * * ***
** * *** ** * ** * **
**** *** * ** *** * * (a[i]!='\0')
** * ** ** ***
**** * * ** * * * * * ** *** *** ** ** ** (a[i]>'A' && a[i]<'Z')
*** * *** * * * * *** * * ** **
* *** * * * * ** ***** *** * * ** * * **** ** ** * ** ** **** *
** ** * * * * * *** * * * **** * * * * * * ** ** *
** * ****** *** * ** * **** ** * ** * * * * ** if (a[i]>'a' && a[i]<'z')
* * ** * * ** ** ** ** * *** ***
** ** *** * * ** ** ** * ** ** * * * **** ******** * * ** *
** * ********* * ***** * *** ** * *** * ** * *
** ** * * ** * * * *** *** * ** * ***
* * ** ****** * * ** * ****

* * ** *** *** * ****** * (l=0;l<j;l++)
    {
** ** ** *** ** * ** * ** * ** ** **** *** ** ***** * **
****** * * * *** *** **
*** *** * ** * * ** 0;

}
最新回答 用戶: (-229 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


int main()
{
* * ** * ** ** * * * str[1000];
** *** *** ** ** **** * length;
* * * *** * * ** ** * i;


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

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


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

**** *** ***** ** * ** * ** ** ** ** ** * * && str[i]<='z')
* ** * * **** * * **** ** * *** ***** **
*** *** * * ** * * * *** ****** ** * * ***** * * * ***** ** * * * ** ****
*** ** * ** * ** ** * ** * ** ** * * ** * * *

* * ** * ** * ** * * *** * ** *** ** *** if(str[i]>='A' && str[i]<='Z')
* *** * * * * * ** ** * *
* * *** ** * * ** * * ** ** * **** *** * *** ** * * * ***** ****** * *** ** **
* * ** * ** *** **** * *** * **** * *****
** * * ** ** * ** *

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

** **** * * * * *** ** * * 0;
}
最新回答 用戶: (-193 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>
int main()
{
* * *** * **** i=0;
*** ** *** * * * * a[1000];
* ** * **** * * * *****
* *** * ** * ** (a[i]!=0)
    {
** *** * **** ** * ** * ** ***** * *** ** (a[i]>64 && a[i]<91)
** * * ****** ** ******** *** ** *** * *** * * *
*** * ****** ** * **** * *** **** * ******* *** ** * ** * ***** * * *
****** **** * * **** *** ** * * *** * ** **
** ** * ** * ** * * *** * *** ********* if (a[i]>96 && a[i]<123)
* *** * * *** **** ** * ****** ** * ***
* * ** *** * * * ** ** *** *** * ** *** ** ** ** ** ** *
* * * * * * ** ** * *** * * ** ** **
* * * * *** * * ** * ** **** * * * *
    }
** ** * * * ** ** *** * *** * * * *****
最新回答 用戶: (-229 分)
0 0
prog.c: In function 'main':
prog.c:19:5: error: expected declaration or statement at end of input
     printf("%s",a);
     ^~~~~~
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.71.254.40
©2016-2025

相關問題

0 喜歡 0 不喜歡
13 回答
[考試] 最新提問 1月 19, 2018 分類:Final Exam |
ID: 43463 - 從幾時開始: 2018-01-20 09:00 - 到幾時結束: 無限制
| 2.4k 瀏覽
0 喜歡 0 不喜歡
6 回答
[考試] 最新提問 1月 19, 2018 分類:Final Exam |
ID: 43462 - 從幾時開始: 2018-01-20 09:00 - 到幾時結束: 無限制
| 1.2k 瀏覽
0 喜歡 0 不喜歡
8 回答
[考試] 最新提問 1月 19, 2018 分類:Final Exam |
ID: 43461 - 從幾時開始: 2018-01-20 09:00 - 到幾時結束: 無限制
| 1.4k 瀏覽
0 喜歡 0 不喜歡
4 回答
[考試] 最新提問 1月 19, 2018 分類:Final Exam |
ID: 43460 - 從幾時開始: 2018-01-20 09:00 - 到幾時結束: 無限制
| 1.4k 瀏覽
2 喜歡 0 不喜歡
30 回答
[考試] 最新提問 1月 16, 2018 分類:Final Exam |
ID: 42298 - 從幾時開始: 2018-01-17 14:00 - 到幾時結束: 無限制
| 5.8k 瀏覽
12,783 問題
183,442 回答
172,219 留言
4,824 用戶