0 like 0 dislike
1.5k views
請完成下列函式

void reverse(int *array,int size);

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

並寫一個主程式測試你寫的函式。
[Exercise] Essay (Open question) - asked in 作業 by (18k points)
ID: 17203 - Available when: Unlimited - Due to: Unlimited
| 1.5k 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
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.126.112
©2016-2024

Related questions

0 like 0 dislike
0 answers
[Exercise] Essay (Open question) - asked Dec 28, 2016 in 作業 by Shun-Po (18k points)
ID: 20139 - Available when: Unlimited - Due to: Unlimited
| 262 views
0 like 0 dislike
20 answers
[Exercise] Essay (Open question) - asked Dec 21, 2016 in 作業 by Shun-Po (18k points)
ID: 19748 - Available when: Unlimited - Due to: Unlimited
| 1.2k views
0 like 0 dislike
82 answers
[Exercise] Coding (C) - asked Nov 23, 2016 in 作業 by Shun-Po (18k points)
ID: 17578 - Available when: Unlimited - Due to: Unlimited
| 3.5k views
0 like 0 dislike
0 answers
[Exercise] Essay (Open question) - asked Dec 28, 2016 in 作業 by Shun-Po (18k points)
ID: 20140 - Available when: Unlimited - Due to: Unlimited
| 290 views
0 like 0 dislike
3 answers
[Exercise] Essay (Open question) - asked Dec 21, 2016 in 作業 by Shun-Po (18k points)
ID: 19755 - Available when: Unlimited - Due to: Unlimited
| 369 views
12,783 questions
183,443 answers
172,219 comments
4,824 users