Toggle navigation
Courses
Questions
Tags
Users
AC 201612010 第二次期中考 第六題
0
like
0
dislike
4.4k
views
請設計一程式,使用者會輸入一個句子,一直到程式讀到句點”.”代表輸入結束,程式會將輸入的大寫英文字母轉成小寫、小寫英文字母轉成大寫後輸出。
輸入說明:輸入會包含英文字母、數字以及標點符號,當程式遇到句點(.)時代表輸入結束。
輸出說明:請將輸入當中的大寫字母轉成小寫,小寫字母轉成大寫,並保留其他的字元輸出。
輸入範例:
It Is A Good Day To Die.
輸出範例:
iT iS a gOOD dAY tO dIE.
[Exercise]
Coding (C)
-
asked
Dec 1, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 18077 -
Available when:
2016-12-01 18:30:00
-
Due to:
2016-12-01 21:00:00
reshown
Dec 1, 2016
by
Shun-Po
|
4.4k
views
comment
0
0
Called for Help
Please
log in
or
register
to add a comment.
63
Answers
0
like
0
dislike
Hidden content!** * * * * * **** ** ****
int main(void)
{
char c;
* * * ** ** * * ** * * *
while(c != '.')
* ** ** * ** ** ** *** *
* ** * ** * * ** *** * *** * * * * * ** **
* * * ** ** * * * * * *** ** = toupper(c);
* ** * * * *** * ** ** * * ** * * *** * * * * *
* ** * *** * * ** * * * = tolower(c);
* * ** * * * * * * ** **** ** *** ** * *** * *
* * * * ** ** * * * * * * *** ** * ** * * * ***** * *
* *** * ** ** * * ** * *
return 0;
}
answered
Dec 1, 2016
by
s31102
(
-100
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!#include<stdio.h>
#include<ctype.h>
int main(){
char c;
* * * ** * ** * * * * **** * * * * &c);
* *** * ** *** * != '.'){
* ** * * ** **** * * ** ** * * * ** **** * *** * ***
** * ** * *** * ** ** * * * *** * * ** * * *** * * * * ** * * * ** *** * = toupper(c);
** ** * * * * ** * * ** ** * * * * * ** * ** * ** * * * * * ** ** * ** * ** c);