Toggle navigation
Courses
Questions
Tags
Users
AD 20161110 exercise 1
0
like
0
dislike
1.6k
views
請完成下列函式
void reverse(int *array,int size);
該函式會將array陣列中所有元素的位置顛倒。
並寫一個主程式測試你寫的函式。
[Exercise]
Essay (Open question)
-
asked
Nov 10, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 17220 -
Available when:
Unlimited
-
Due to:
Unlimited
|
1.6k
views
comment
Please
log in
or
register
to add a comment.
20
Answers
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include * * * ** *
void reverse(int *array,int size);
int main (void)
{
* * ** ** *** * *** ** array[5] = {1,2,3,4,5};
* * * * * * * ** j=0;
* ** ** * *** ** ** ** *
* ** * * ** **** * * * *** * 5);
* * * * * * **** * *
* ** *** * *** *** * * * *** ***** *
** ** * *** * ** ******** * * * * **** ",array[j]);
** * ***** ***** * ***
* ** * * ******** **** * ** * * *** * **
* * ***** * ** * ** ** 0;
}
void reverse(int *array,int size)
{
** *** ** ** * * *** tmp=0,
* * * ** * * ** ** * * * * **** ** ** * * *
*** * ** * ** * ** * *** ** **
* * * **** * ** * ** ***** ** *** **** **
* * * *** * ****** * * * *** * *** * * * * * * * = *array[i];
* *** * * ** ** ******* * * * ** ** * ** * * * *** * * ** *** = *array[size-i-1];
* * * * ***** ********* * ** * * *** ** ** * * = tmp;
* ** * * **** ** *
}
answered
Nov 10, 2016
by
410423016
(
-170
points)
ask related question
comment
Please
log in
or
register
to add a comment.
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
Nov 10, 2016
by
410523005
(
122
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
* *** ** * * * * **
* * ** * * *****
void reverse (int *array,int size);
int main(void)
{
* * * ** * * * i,j,n;
*** * ** *** * *** ** ** ** **** ** * **
** ** * * ** * * * * * a[n];
* * **** ***** ** * * ** = 0;i < n;i++)
** ** * ***** * *** *** * * * * ** * ** ***** ** * * ** * ** ** * *****
* * * * ** ******* ** * * * * ** &a[0],n);
*** * * * * * * * *
* *** * * ** * ** * * ** ** *
*** * ** * * * ** * ** = 0;i < n;i++)
* ******* * * * * *** *** * ",a[i]);
* *** * * * * **** ***
* **** * ** * * * * ** ** *** &a[i], &a[j]);
** * ** * * * *** * ** %p, ** * ** *** &a[j]);
*** * ***** **** ** **** ** &a[j]);
* * **** ** ** ** * *
* * * * ** ** ** ** * %d\n", a[i], a[j]);
*/
****** * *** ** * * **** * ** **** ** ** *
**** * ** * * * * ** ** 0;
}
void reverse (int *array,int size)
{
* ** *** *** ** ****** **** temp, i, j;
* * * * ** * * * * * * *** ** * ** ** * * ** ** ** * * * *** * *
** * * * * * ** * *** ** * (i=0;i < size/2;i++)
* ** * *** **** **
**** * * ***** * * * * ***** ** ** * = array[i];
**** * ** ****** ** ** ** *** **** * * *** = array[size-1-i];
****** * * * ** **** *** * ** ** ****** ** * * * * * = temp;
** *** ** ****** ** *** ** * * ** **** **
** ******* *** ** ******* ******* **
** **** ** ** *
}
answered
Nov 10, 2016
by
goodboy110222
(
-186
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
**** * *** * *
**** * * * * **
void reverse(int *array,int size);
int main(void)
{
* ** **** *** * ** ** * * i,n;
******* * * * * *** ** * **** *** * * *
* * * * * * ** **** * * data[n-1];
* *** * * * * ***
* * **** ** * ** * * *** = 0;i < n;i++)
****** * *** * ** ** * * * ****** * * ****
** * * * ****
***** ** * **** * ******
*** * * ** **** ** * ** *
*** **** ** ** *** ** = 0;i < n;i++)
* ** * *** **** *** *** ***** ** ** * * ** * **
** * ** ******* **
* * * ** * ** ** *** * **** ** **
* * **** ** * *** * **** *** 0; * ** ** * * ** ** ***** * ** ** * *
}
void reverse(int *array,int size)
{ * ** * * *****
* * * ** **** *** i,temp; ** *** * * * **
*** ** * * * * * ** = 0;i <= size/2;i++)
* * ***** *** * = *(array + i);
* *** * * * ** ** * ** * * + i) = *(array + size - 1 - i);
** * * **** * ** * * ** + size - 1 - i) = temp ;}
* ** * ** * *** ** *** *
answered
Nov 10, 2016
by
謝秉弘
(
-264
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include * *** *** ***
void reverse(int *ptr_array,int size);
int main()
{
****** * ** ** * ** * * n , i ;
* **** ** ** * * **** ** ** *** *** * * * * *
**** **** * *
* **** ** *** * * * * * ** array[n] ;
* * * ** *** **** *** * * * = 0 ; i < n ; i++)
* * * **** * ** * * ** * ** * * ******* * *** ** ** * *** ** * ** *** * * ***** * **
** * * ** ** *** ** ** * * * ** * ** * * ** **
**** ** ** ** * *** ** * * *
* ***** * * *** *** ** * = 0 ; i < n ; i++)
* ** * ** * *** * *** * * * * **** * ***** *** * * ** * * ** *** * * * *** * ** ** *
** * * ** * * **** **
** **** *** *** ***** ** * *** *
** ** **** * * * * 0;
}
void reverse(int *ptr_array,int size)
{
** ** * * ** *** * **** * ** * tmp , i ;
** * * * **** ** *** **** * * = 0 ; i < (size / 2) ; i++ )
** * * ** * * * * * *
*** * * * ** ** *** * *** * * * ** * * * * * *** * ***** ** * * = *(ptr_array + i);
* * * ** ** ** * *** ** ** ** ** *** * * * * * * * *** * ** ** * ****** ** + i) = *(ptr_array + size - i - 1);
** **** ** ** * * *** ******* * * * ** *** * * * **** **** ** * + size - i - 1) = tmp ;
* *** * ** * * *** ***
}
answered
Nov 10, 2016
by
Phoenix666
(
-162
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
#include<stdlib.h>
void reverse(int *array,int size)
{
*** ** * * * *** *** * ** i,tmp;
* ***** * * * * * ****** * *** ** **** * **
** *** * *** **** ** * *
***** * *** * * *** **** ***** * ** ** ** * ** ** * * * * **
*** *********** * * * ** * **** ** * * *** ** *** *** ** *
* *** ***** ** *** *** * ****** * * ** * ** ** ** ***** * ******
** * ** * *** * *** ** ***
}
int main()
{
* *** * * * * ** * * *** i,n;
* ***** ** ** ** * *** ******* ** * ** ***
** **** *** ****** * * * array[n];
* * * ** * * **** **** ************ **
* * * *** ** ** * * *** *** * ** ** ** * **** * ******* * **
* * * * * ** *** * **** ** * *** **
* * *** * * ** * ***
** ** *** * *** * * ** ** * ***
* * * * ** * ** * * *** * * * *** * ** * ** ",array[i]);
* * * ***** * * * ** * * * * *
* ** *** ** * *** ** **** ** * *
* * ** ** * * ** * 0;
}
answered
Nov 10, 2016
by
410523043
(
156
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
** * *** **
int ***** *
int i;
int ****
*** ** * *
* * * ** * * ****
swap *** ***
*** 0;
}
* * * * *
{
int i;
** ** * **
* * ****** ** ** *** ** ** ** * %d * ** * ** *
}
answered
Nov 10, 2016
by
爾皓
(
-304
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
*
**
* ** * ** * *
*** ***
** ** ** *** ** * ***
* *** *
* * * *
* * * ** * * *
* * ** * *****
* *
*** * * * ** * * * **
* **
* ** * ** * **
*
* ** **
* *** * * ** * ***
* * ** * * *
* * }
}
answered
Nov 10, 2016
by
楊傑宇
(
-202
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include * *** *
void reverse(int *array, int size);
int main(int argc, char *argv[]){
** *** ******* * * ** * * a[100],i,n;
***** ** * * * ** * *
* * **** * ** ** *** * ** ** *
* * * * ** ** = 0; i < n; i++){
* ** ******* * * *** ** * ** * ** ***** * *** * * * * * *** ** ** * **** *
* * * * * *** *
* *** * * * **** *
* * ** ** ** ***** n); * * *** **** ** * *** * ** *
*** * * * *** * ***
** * ** ** * * **** * **** = 0; i < n; i++){
* * * ** ******* ** * * ** **** **** * *** * * ** ",a[i]);
* * * *** *** ***
********** ** *** ** *** *
********** ** * * **** ****** ***** * ** *** ** ** *
* ** * ****** *** ** 0;
}
void reverse(int *array, int size){
* * * * * ** * * ** temp,i;
** ** * ** ** ** * * ** * = 0; i <= size/2; i++){
**** * * **** * *** ** **** * ** * *** *** * *** = array[i];
* * **** ** * * ***** * * **** ** *** ** * ** ****** * **** * ** * ** ** = array[size-i-1];
*** * ** * ** * * * * * * **** * * *** ** * ** * * ** * = temp;
******* * *** * **** **
}
answered
Nov 10, 2016
by
Dhgir.Abien
(
-216
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
* * *
* ***** * ** * *** *
int main()
{
** *** * ** * * * *
** * * * * * 0;
}
void reverse()
{
* *** ** ** *** *** * * * array[3]={1,2,3},i;
********** ** * * * *** * ****
*** * ****
** ** *** ** * * * * * ** * **** * **
** *********
}
answered
Nov 10, 2016
by
jack2234567
(
-190
points)
ask related question
comment
Please
log in
or
register
to add a comment.
Page:
« prev
1
2
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English
中文
Tiếng Việt
IP:172.69.59.99
©2016-2025
Related questions
0
like
0
dislike
23
answers
AD 20161222 exercise 1
[Exercise]
Essay (Open question)
-
asked
Dec 22, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 19793 -
Available when:
Unlimited
-
Due to:
Unlimited
|
1.7k
views
0
like
0
dislike
65
answers
AD 20161124 exercise 1
[Exercise]
Coding (C)
-
asked
Nov 24, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 17667 -
Available when:
Unlimited
-
Due to:
Unlimited
|
3.8k
views
0
like
0
dislike
7
answers
AD 20161222 exercise 2
[Exercise]
Essay (Open question)
-
asked
Dec 22, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 19794 -
Available when:
Unlimited
-
Due to:
Unlimited
|
831
views
0
like
0
dislike
26
answers
AD 20161103 作業1
[Exercise]
Coding (C)
-
asked
Nov 3, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 16957 -
Available when:
Unlimited
-
Due to:
Unlimited
|
1.9k
views
0
like
0
dislike
37
answers
AD 20161020 作業 1
[Exercise]
Coding (C)
-
asked
Oct 20, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 14579 -
Available when:
Unlimited
-
Due to:
Unlimited
|
2.5k
views
12,783
questions
183,442
answers
172,219
comments
4,824
users