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 | 123 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:172.68.65.206
©2016-2021

Related questions

4 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 3, 2018 in 程式設計(一)
Available when: Unlimited - Due to: Unlimited
| 342 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
| 155 views
2 like 0 dislike
0 answers
[Normal] Fill in the blank - asked Feb 11, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
Available when: Unlimited - Due to: Unlimited
| 57 views
11,163 questions
132,617 answers
129,948 comments
3,823 users