Toggle navigation
Courses
Questions
Tags
Users
AC字串練習 輸入一個字串再讓其相反輸出
2
like
0
dislike
1.5k
views
請撰寫一個程式,其程式讓使用者輸入一個字串,再讓使用者輸入的字串從尾到頭相反輸出。
範例輸入1 abcde
範例輸出1 edcba
範例輸入2 abcde12345
範例輸出2 54321edcba
[Normal]
Coding (C)
-
asked
Dec 21, 2016
in
2016-1 程式設計(一)AC
ID: 19745 -
Available when:
Unlimited
-
Due to:
Unlimited
reshown
Jan 5, 2017
by
Shun-Po
|
1.5k
views
comment
Please
log in
or
register
to add a comment.
14
Answers
0
like
0
dislike
Hidden content!
* * ** * * ** ***
* * * *** * ***
int main(){
** * ** * * * ** * a[80];
** ** ***** * ** * i, len, tmp;
**** * * * ** **** ** * * ** ** **** a);
**** *** * ********** * * ** a);
*** **** * * *** * ** = ** * *
* ***** * *** ** **** ** **** * * len);
* * ** ** ** *** = 0; i < len / 2; i++){
* * * * * *** ** *** * * ** = a[i];
** ** * * * *** * *** * * * ** ***** = a[len - i - 1];
** * ** * * ** * * ** ** ** - i - 1] = tmp;
* ** ***** ** ***
** ** ** * *** * * **** * ** * a);
return 0;
}
answered
Jan 2, 2017
by
410342026
(
-105
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include * * * * **
#include ** * * *** *
void **** str[]);
int length(char str[]);
int main(int argc, char *argv[]) {
** ** *** * ** ** * ** * str[100];
* * * ** **** * * ** * *** * **
** **** * **** ** *** * *** *
** ** ***** ** * ** * *** **
***** * *** * * * * ****** 0;
}
void reverse(char str[]){
* * ** * ** * ** * ** * *** *
*** * * * ** ** ** ch;
* ** ** ** * ** ** ** * i = 0; i < l/2; i++ ){
**** ***** * ** ** *** * *** ** * ** * * *** * = str[i];
* * * * ***** ** **** * * * ******** * * = str[l-i-1];
* * * * *** * * ** * * * * *** * ** * * = ch;
** ** ** * ** ****** **
}
int length(char str[]){
* * ** * * *** * * * **** i=0,cnt=0;
* ** * *** ****** * * ** * * **** ** *
** * **** * ** * * ** * * *** * * ** * *** * **** **
** * *** * * * * ** * ****
* ** ** ** ** ******** ** ** ** cnt;
}
answered
Dec 28, 2016
by
李奕叡
(
-143
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
** * ** * * **** **
*** * ***** ** **** **
* * * **
**** ** *** ** * * *
** * ** * **
{
* ** *
** * *
* ** * * * ***
* = *** * *
* * ** ** * **
* * % 2 == **
*
* (i = * *** * * ***
{
* * * * *** **
** ** * * * * j = * * - i - 1;
** * ** ****
* * *** **** * * * *** ** * * * *
* * *
* * ** * ** v = ****
* *** *
*** ** **** * *** = * *
**** * ** *****
* *** * * * * = v;
** ** ** * ***
}
}
**
{
* * * *
(i = * * * ** **
{
* * ****
** * j = *** - i -
* * * **
** * ***** **** * *** **
** * * * * *
** * **** * * v = ****
* * * * **
* ** * * * = * **
* ** * *** *
** ** * *** ** ** = v;
*** ***** * *
}
* ** *** **
}
** * * *** *** * ******
** * **
}
answered
Dec 21, 2016
by
410523007
(
-157
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
* * * * *** **
** ** ** * * ***
int main ( void )
{
* ** * * ** * *** * i , length ;
** ** ** * * **** * ** *** * string [80] , temp ;
* **** ****** **** ***** ** * ("%s ",string );
*** *** *** *** ** ********** string );
** * ****** * * ** * * *
* ** *** ** **** ** ** * ***
* * * * ** ** * * **** ***** ** *** ** ***** ******** * **
* * **** * * * ** *** * * * * *** ***** ** * * ** * **
******** * * * * * *** * * ** **** * * * ** [ length-i-1]=temp;
* ** * * * ** * *** * *
* ** *** * * ***** *** *** ** ("%s\n ",string);
* ***** *** **** **** * 0;
}
answered
Dec 21, 2016
by
Jim870729
(
-102
points)
ask related question
comment
Please
log in
or
register
to add a comment.
Page:
« prev
1
2
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English
中文
Tiếng Việt
IP:172.69.17.58
©2016-2025
Related questions
0
like
0
dislike
3
answers
AC字串練習-製作一個編碼器
[Normal]
Coding (C)
-
asked
Jan 3, 2017
in
2016-1 程式設計(一)AC
by
410425014
(
-162
points)
ID: 20514 -
Available when:
Unlimited
-
Due to:
Unlimited
|
605
views
0
like
0
dislike
3
answers
AC字串練習 設定一組密碼
[Normal]
Coding (C)
-
asked
Jan 5, 2017
in
2016-1 程式設計(一)AC
ID: 20997 -
Available when:
Unlimited
-
Due to:
Unlimited
|
612
views
12,783
questions
183,442
answers
172,219
comments
4,824
users