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>
* * * *** *

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)
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.50
©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