0 like 0 dislike
4.6k 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
| 4.6k 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>
* * *** *** * *****

void reverse(int *array,int size)

{
* * *** * ** * ** * ** i;
****** * ** * ** tmp=0;
***** *** * * ****** *
* * * *** ** *
* * * * * * * * ** * * **
***** ** ** * * * * *** * ** ** ***** * * **
********* *** * * * ** * * *** * ** * *

   }

}



int main()

{
* * * ** *** *** n;
* ** * * * * * * * * **** * ** *
********* * ** ** * array[n];
* * * * * * * * * i;
* * * ** ** * * **

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

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

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



#include<stdio.h>



 



void reverse(int *a,int k)



 



{


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


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


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


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


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


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


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


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


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



 



}



 



int main()



 



{


** * *** * ** *** * i,k;



    


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


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


*** **** * ** *** a[k];


* * * * ** * **


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



    


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


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


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


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


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


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


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


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


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


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


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



    



}
answered by (102 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 (-82 points)
0 like 0 dislike
Hidden content!
****
**
* **
* *** *** * *
*
* * **
* * ** **
*
* * *
* * * * ****
* * * **** * *
*

* ** **
{

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

#include <stdlib.h>



void reverse(int *array,int size)

{
** * ** ******* * * ** * * * i;
* * ** ** * *** *** * tmp=0;
***** * * * *** * *** * ** ** *
** * ** * * **
* ** * * ** ** * ****** **** ** *** * ****** * **** * **
* *** * **** * * **** * * **** ** ** *** *** = *(array+size-1-i);
**** * * * ** ** * ** * * * * *** * ** * * * * * * ***

    }

}

int main()

{
** ***** *** *** * * **** n;
*** * ** *** ** **** * * * * * * ** ** * * **
* **** ** ** * ** * * array[n];
************ **** ** * i;
** * * * * * * *** ** * ** * ** **

    {
* * ** ** * * * * *** * ****** *** * ** * * ** * ** * ** *** * *** *** **
* * * * ** * **** *
* ** * ** ** **** * ** *** **
** * * * ****** *** * *** *** * * *
****** ****** * * ** * *** * ** * ***** ** **** * * * * * * ",array[i]);
*** * * * **** * * * * * * **** ** ** *
** *** ** 0;

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

#include <stdlib.h>



void reverse(int *array,int size)

{
** *** * * * * * r[100]={0},c;
* * * ****** * **** ** * * ** **
* * * * *** * * * * * *****
**** * *** * * * * * * * * * * * ** * * = array[size-c-1];
*** * ** ** * *** * * *
* ** *** *** * * * * * *****
* * * ***** *** **** *
** ** * *** ** ** *** *** * ***** ** * * * *** ** * * * = r[c];

    }

}



int main()

{
* ** * * ** ** *** a[100]={0},b,c;
** * * * ** * * *** * ** *** *** ********** *
* ******* * * ** ** * *** ** * **
* * * * ** * ****** * *
**** * ** ** * ** * ** * *** ** *** **** **** * *** * *
* ** ** ** ********* *
** * * **** * * * ****** * ** *
** ** *** ** * * ***** ** *** ** ** *
* * ** * * * * * *** *****
** * *** *** *** ** ** ** * *** ** *** ** *** * **** * ",a[c]);
* * * ** *** * ***** **
* *** ** * * * ** * * 0;

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

{


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



}
** * *

{
**** * * ***** * *** *x ;
* * ** *** ** *** * *p ;


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


** p = x ; *p != 0 ; p++)

;


* ;p * ***** x; p--)

{
** * * * *** *

}


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

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


** ** ** * * **


* ** * ***


* * * **



{


* * * *


** ** = 9;


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


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


***** **



{


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


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



}


* ******


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


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



{


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


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



}


* ** 0;



}


** * * * * * **


*


*** ** ** % * **





* * *** ****


*


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


*


*


{ * * * ** *





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



}


*


* ****



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

* **

* **

* * =

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

*** = **

*** ** * ** * **

* * * * ** *

{

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

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

}

* ***

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

*** ** ** ** *

{

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

* * * ** = * * *

}

*

}

* * * ** *

{

** *** **

* % * *

{

* * ***** *

{

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

* *




* * * * * ***

{

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

*
* ****

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



# **** * * ** * ** **** *


* * *



void ** * * * ** ** size);



int main *


* ** * ** ** *** ** i, * *


* ** ** * * ** ** ** ** = ** ** size; i-- )


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


* **


* * * *** * * total;



}



void * (int * *


* ** * *** * * ** **** * array [i] ;


* *** * * ** ** ** * ** * * * * * ** ** * * ,i));


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


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



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

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
| 697 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
| 3.8k 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
| 11.2k 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
| 734 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
| 1.1k views
12,783 questions
183,442 answers
172,219 comments
4,824 users