0 like 0 dislike
請完成下列函式

void reverse(int *array,int size);

該函式會將array陣列中所有元素的位置顛倒。

並寫一個主程式測試你寫的函式。
[Exercise] Essay (Open question) - asked in 作業 by (18k points)
Available when: Unlimited - Due to: Unlimited
| 301 views
1 1
Called for Help
0 1
Called for Help
0 1
Called for Help

26 Answers

0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <stdlib.h>

void trange(int *data,int len);

int main(void)

{
** * * *** ** * *** k,j;
** * * * * * * * * * * * * * * ** *** *** **
*** * ** *** * input[k-1];
* * **** * ** * * *** * * * * * ** *
*** ** * * * * * * ** ** *** * ***** ** **** * * **

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

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

    }

void trange(int *data,int len)

{
* * * *** ** ** a,k,j=len;
**** ** * *** ** *** * ** * * *** * * * * *** * *** *** ** ** **** * ** **
* ** *** * *** *** * (0==len%2)
*** ** * *** * * ***
***** ** ** * ** ** ** ** ***** ***
* * *** ** * * *
*** **** * * * ** * ** **** * ** * * * ** **
* *** * *** ******** ***** * ** * ** *** * ***
*** *** * * * *** ** * * * * **** **
* * **** *** * * * ** * ** **** * * * * *
*** ** * * ***** * * * *** ** * ** **
* *** * ***** * * **
****** **** **** ** ** ****
* * * ** * *
** *** * * ** * * * * ** * * * * ** **** * * * ** * *

    {
* ** ****** ** * * * ** * ** * ******* * * * ** *
* ** *** *** ** * ** ***** ** * ** * *** * * * ****
* ** * ***** ** ** * * *** *** * ****** * *
*** ** * * ** * *** ** * *** **
* * * *** ****** *** * ****** **** * ** ** ***

    }
* *** * * ** ** ** * *** * * * *
* * * * **** ***** ** ** * **** ** ",data[k]);



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

#include <stdlib.h>



void reverse(int *a,int s);



int main ()

{
* * ** * ** ** *** * b,c;
** ***** ** * ** *** **
** ** * * ***** * ** * ** * **** ** *
* * * ** * *** * * ***
* * ** * **** ** * a[c];
*** * **** ** *
* * ******** * ** * ** * (b=0;b < c;b++)
*** * * *** * ** *** ***
* ** ** * * *** ** * *** * * * ** * *** * ** ***** ******** ** ** *** * *


* * * * *** * * ** *** * * **
* * ** ** * ** **
* *** **** * ** * ******** * (b=0;b < c;b++)
*** ** * ** ** **
** * * *** ** ** ***** * ",a[b]);
** * * * * *** **
* ** * * ***** ** ** ***** * * ("pause");
* * * * ** * ***
** *** * * * *** ** *** 0;



}



void reverse(int *a,int s)

{
* * * *** *** * * * * i,t;
** * * ** * *** *
*** * ** ** * *** * ** ***** *
* * **** ** * * * *****
* ** * ** ** * * ****
** *** * ***** * **
*** ** * **** ** **** *** ** ****** * * * ** *** **
** * * ** * ** **** ** *
***** * * * * ** ** * *** ** * * ** ** * *** *

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

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

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



int main()

{
* * * * * ** *** * ** * array[5] = { ** * * };
*** ** * ***** * * *** i;
* * * *** * * * (i = 4;i ** * 0;i--)


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


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

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


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

{
* * * ******
*** ************** *** *
* = ** * ** **
*** * * ** ** *** **** *


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


* * = * * * * *
** ** * ** * *


** * *


***** 0;

}


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

{
* ** * n;
** = * / * *
*



n = *** + **** * + i) = * * + * - 1 - *** + * - 1 - i) = n;



}



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



#define LEN =size

void ** * * * * size);

{



int i,size;
** * ** **
* ** ** * **** * ** ** **
*** *** ***** *
** *** ** ******* ** *
* ** ***** * * *** *

return 0;

}



int main(void)

{
* * **** * * *** * ***** ***
* * ****** * ***** *** **** **
** ********* ***** * ***** * ** * ** **
* * ** * ** * 0;



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

#include <stdlib.h>



void reverse(int *x,int y){
* ********* * ******* * b[y],ii,jj;
*** ** ** * * *** * ** ** ****** ** ** *
* ** * * * * * *** ***** * * * ***** ***** * **
* ** ** ** * * ** **
****** * *** * * * * ** * ***** * * * *
* ***** * ** * * ** * * * ****** * * *

    }

}

int main(){
*** *** *** * ** ***** n,i;
* ** * ** ********** *** *** * * ** ** * * *
* **** ** ** **** * * ** * ** a[n];
** * * ** * ** * * ** ** ******
**** * ** ** * * **** ***** * * *** * * * * * * * * * * ***** * *

    }
* ** **** * ** ** **** ** * *
** ** **** ******** ** *** ** ** **
* ******* ** * * ** * *** ** * *** * * * *** *** * * ",a[i]);
** * * *** * * * *** *
** * * * *** * ** * 0;

}
answered by (-126 points)
edited by
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.158.78.20
©2016-2020

Related questions

0 like 0 dislike
0 answers
[Exercise] Essay (Open question) - asked Dec 28, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 100 views
0 like 0 dislike
20 answers
[Exercise] Essay (Open question) - asked Dec 21, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 217 views
0 like 0 dislike
82 answers
[Exercise] Coding (C) - asked Nov 23, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 522 views
0 like 0 dislike
0 answers
[Exercise] Essay (Open question) - asked Dec 28, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 70 views
0 like 0 dislike
3 answers
[Exercise] Essay (Open question) - asked Dec 21, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 83 views
10,747 questions
120,642 answers
112,784 comments
3,802 users