0 like 0 dislike
994 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
| 994 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:172.70.174.40
©2016-2023

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
| 237 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
| 792 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
| 2.1k 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
| 162 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
| 288 views
14,435 questions
231,450 answers
206,247 comments
5,485 users