2 like 0 dislike
3.6k views
請撰寫一個程式,其程式讓使用者輸入一個字串,再讓使用者輸入的字串從尾到頭相反輸出。
範例輸入1  abcde
範例輸出1  edcba

範例輸入2  abcde12345

範例輸出2 54321edcba
[Normal] Coding (C) - asked in 2016-1 程式設計(一)AC
ID: 19745 - Available when: Unlimited - Due to: Unlimited

reshown by | 3.6k views

14 Answers

0 like 0 dislike
Hidden content!
* * * * ** * * *
* ** * * * * ***

int * ***

{
** *


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

for (i = 9;i * 0;i --) * ** * ** ** ** *


* * 0;

}
answered by (-276 points)
0 like 0 dislike
Hidden content!
* * ***** ***** * **
** ** * *** ** * **
** * *

{
* ** *


(i = 0;i * * 5;i ++) * *** * * * * *** *
* * (i = 4;i ** ** ** ** *** *** * *** **


** 0;

}
answered by (-276 points)
0 like 0 dislike
Hidden content!
* ** ***** * * * * *
** ***** * * *







int main()

{
******* * ** * ** a[100];
***** * * ***** * temp;
* * * ** * *** ** * i,l;
* ** * ** * * *** ** * *
* ** ***** ** * *** *

  

  
* ** * * * * ** ** * *** **
* * * ** * * * * * ***
** * * * * * * **** **    temp=a[i];
*** * ** ** ** *** *** * * *
** ** *** * * * *** *   ** * **** ** *

  
** *** *** *** * *
* **** * ***** * * ***** * *
* **** *** * * **
* * * *** ****** * * ** * 0;

}
answered by (-158 points)
0 like 0 dislike
Hidden content!
* ** * * *** *
*** * * *****
**** * ** * *
*** * * ****



int main (void)

{   
* ** * ******* * ** a,b,c,d,i,k,j;
*** * ** *** * **** s[99],x[99],z[a-1];


* * ** ** ** *** * * * ** ("%s",s);
** ***** * ** ** ** **
* * * * * * * ** ****
* * * * * ** * **** (i=a-1;i>=0;i--)
** * **** * ***** *** * * * * * ***
*** ** *** *** * *** ** * *
** * * *** * ** * **** ** (k=0;k<a;k++)
** * * * ***** *** * * * *
** * * * * * * *
*** * ** * ***** *
*** ** * ** *** *** ("%s\n",x);
** ** * * * ** ****** ** ** *** * **
** *** * * ** ** * **** ** ** *** **** *
****** * * ** * * * * * ("%s",s);


* **** * * ** * * * * 0;

}
answered by (-136 points)
0 like 0 dislike
Hidden content!
* *** * ***** *
** *** * * *** * *
*** * **
* * ** * *



int main (void)

{   
***** ** * * * * * *** a,b,c,d,i,k,j;
* *** * *** **** * * ** * * ** s[99],x[99],z[a-1];


** ** *** * * ** ("%s",s);
***** * ********* ** ** **
** * * * * ** *** ** *
***** * ** * ** ** * (i=a-1;i>=0;i--)
* * ** *** * ** * ** * * **
** * ** * * ** ****
* * * * ** * * * * * ** (k=0;k<a;k++)
* ** * * ** * *** **** ****
* ** * * ** * ** ** ****
** ** ** ** * **
* * ** ** *** * ***** * (" %s\n",x);
*** ** **** * ** ** * ** * **
* * * *** * *** * *** * ** ** * * *** **** **
* **** *** * * * *** ** ** ("%s",s);


** * *** * * * * * ***** 0;

}
answered by (-136 points)
0 like 0 dislike
Hidden content!
* *** *** * *
** **** *** *
** * * * * **** **
* * * ******* *



int main (void)

{   
*** * * * * * * ** *** * a,b,c,d,i,k,j;
* *** * *** * * * * * s[99],x[99],z[a-1];


* * ** * * * ** * ** * * * ** *** *
* ***** ***** * * *** **
** **** * ***** *****
* * * ** * * * ** (i=a-1;i>=0;i--)
** * ***** * * *** * *
* ** * *** * *
** * * *** ** * * (k=0;k<a;k++)
*** * * **** ** * * *
* * * * * * ** *
* * * ** **** ** ****
*** * * * ** *** * * * ** ** *
** * * ** ** ** * * * *** *** ** * * ** ** * *
* * ** * ** ***** * * * ** ** ** ***

    //printf * * * ** ** *



    return 0;

}
answered by (-136 points)
0 like 0 dislike
Hidden content!
#include ** * ** *** *

#include * *** *** *** *

void reverse(char str[]);

int length(char str[]);



int main(int argc, char *argv[]) {
* **** ******** * ***** * * ** * * str[100];

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

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

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

** *** ** ** * *** *** ***** * 0;

}

void * **** 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 by (-100 points)
0 like 0 dislike
Hidden content!
** * * * ** *
* ** * **** * * * **







int main(void)

{
***** *** *** ** s[100];
* * * ** * * **** tmp;
** *** * ** * ** ** i,k;
** * * *** * * **** *** * ***
* * * * ** * ***** * ****




* ** **** ** *** * **** ** ** * *
* * * * ** * *
** ***** ** *** * *    tmp=s[i];
** ** ** * * * ** * * *
* *** * *** ***    s[k-i-1]=tmp;


*** * *** ******
* * * *** * * * ****** ***** * *
** ***** **** * *** * 0;







}
answered by (-120 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include * **** * **

#include <string.h>



int main()

{
** **** * ***** * * * s[100];
* * ** * *** ** * * l,i;
** * ** * * * *** ** * *** * ***
*** * * *** * = strlen(s);
** ** * * * * * ** * * * * *
****** *** *** ** * *
* ** * * * *** * * ** * * * ***** * * * ** *** *** * ** * *
** *** * * * ** ** *
*** *********** * **** * * *** 0;

}
answered by (-85 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>

#include<string.h>

#include <ctype.h>

int main(void)

{
* * **** ** * **** ****** i;
* ** ** ** ** * * len;
* * **** * ** * * * * s[100];
* ** * **** * * c;
****** *** ** * * * *** * ***
* ** *** * *** * * * ** * *
** ** ** * ** ** * * ** *** * ****** **
* * *** ** * ********* * *** **** ** ** * *
** ** * *** * * ** ** ** ** ** *** ****** *
* * * ** * * ** * * * ** *** *** *** *
* ** **** * * **** * * ** ** ** ** ** * * * *
* ** * * * ****** ** ***** * * ***** **** **
* *** ** *** * ** *** * * * *

}
answered by (-124 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.159.115.9
©2016-2026

Related questions

0 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 3, 2017 in 2016-1 程式設計(一)AC by 410425014 (-162 points)
ID: 20514 - Available when: Unlimited - Due to: Unlimited
| 1.4k views
0 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 5, 2017 in 2016-1 程式設計(一)AC
ID: 20997 - Available when: Unlimited - Due to: Unlimited
| 1.4k views
12,783 questions
183,442 answers
172,219 comments
4,824 users