4 like 0 dislike

將英文字母(不超過5個字母)的位置依照下述方法排列

若有奇數個字母,中間保持不動,兩旁的字母各自反轉

若有偶數個字母,左右方成兩邊各自反轉

input hswo
output show
input ehlol
output hello
input on
output on

 

[Normal] Coding (C) - asked in 程式設計(一)
Available when: Unlimited - Due to: Unlimited

retagged by | 32 views
0 0
excellent

2 Answers

0 like 0 dislike
Hidden content!
* ** ** * ****
** *** ** * *
int main()
{
* ** ** *** char arr[10];
****** * *** **** ** * * * * *** * *
*** * {
** * ** ** ** * **** int i,j;
* * * **** * *** ***** * char temp;
* * * ** **** *** ** **
** * * *** * ** * * if(i==5)
* ** * **** * * {
* *** **** * ** *** * *** * * * *** * *
* * * * * ** ** ** * * ** ***** *
** * ** * *** * * ** * ** *
* * *           ** *
*           **** *
* ** * *       ******   * * *
** * *** *** ** ** *   * ** * ** * * ***** * * ****** *
**** * * ** ** }
* * * ** * * ** * * ** ** else if(i==4)
* * * * * * * **** {
* * * * **** * **** * ** ***** * *
* ** *** ** *** ** ** * **** * ** * * *
* * * * * ** * * * ** * * * * ****** * *** ** **
** * * * *** ** * * *** * ** *** * * **
* ***** ** ** * * * * *** *** * * * ***
* ** * *** ** * * * * ** *** *** * ***
** ** *** ** * * ** * ** ** *** *** *** * * * * * *
*** * **** * * * * }
*** * ** * *** ** ** else
**** ** **** ** * **** {
* ** ****** ** * * * * ** * *** * * * * * ** **
* *** * * *   **** }
* *** ** * ** }
* * *** * ** * return 0;
}
answered by (100 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include<stdio.h>

int main()
{
    int n,i;
    char arr[5]={0};
*** * * ** * * ** * * * * ** * *
* * * * * ** * ***** * * * **** ** ** ** ** ***
    {}
* * * ******* * ** * * **** *** **** * *
* ** * * **** ** ** *** **
* * ** ** ** *** **** * * * *** * * * *** **
** * * ** ******* * ** * **
** ** * * ** * * ** *** * ***** ** *
**** * *** * * ** * *
**** *** * ** * * *** * ** *** * * *** * ** * ***
* ** ***** * * * ***
** ** ** * ** * ********** ** ** * * *** *** ***** **
* **** ** *** *** * * ****
***** * * * * * *** ** ** ** * * * * ** ***** **** * ****** * **** *
* * * * * * * * * * * * ******* * **** ***
}
answered by (192 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:108.162.221.219
©2016-2019

Related questions

4 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 3, 2018 in 程式設計(一)
Available when: Unlimited - Due to: Unlimited
| 80 views
4 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 3, 2018 in 程式設計(一) by semicolon (5.2k points)
Available when: Unlimited - Due to: Unlimited
| 42 views
8,033 questions
60,929 answers
33,033 comments
1,100 users