Toggle navigation
Courses
Questions
Tags
Users
AD 20161110 exercise 1
0
like
0
dislike
1.7k
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.7k
views
comment
Please
log in
or
register
to add a comment.
20
Answers
0
like
0
dislike
Hidden content!
*** *** * *
**** ***** * * *****
int **** *array,int size);
{
* * * * *** * ** i , tmp;
** * * * * * *** * * ** ; * * ; i++)
**** * **** ** * * * * ***
** *** ***** ** ** ** ** * * * * *** * * ** * * * ** * *** = *array[i];
* * ** * * * * * * * * * * * *** * * * ** * * * **** * * * *** * = * * **
** * ** ** * ** ** * *** ** **** ** * **** * * * * **** ** ** * = tmp;
* *** *** * * ** ** * * * * * ** * **** **** * * ** *** ** ** tmp;
***** ** * *****
* ** * *** * * * ***
}
int main(void)
{
int * = {0};
int size , i ;
* * ** * * * ** * , * *
for(i=0 ; *** **** ;i++)
{
** * ** * * **** * * * , *** *
}
for(i=0 ; ** * ; i++)
* ** ** ** * *** * *** ** *** , array[i]);
*** , size);
** **** * * ** ** *
return 0;
}
answered
Jan 7, 2017
by
410223045
(
-194
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
** * *** * * *
* **** **** ** **
int reverse(int *array,int size);
{
*** **** * * *** * **** i , tmp=0;
** ********* * ** *** ** ; i<size ; i++)
* ** * * * * ** ** **
* * * ***** * **** * **** **** ** * *** * * * ** * * * ****** = *array[i];
* * **** * * *** * * ** * ***** * ** ** * ** * ******** = * *** *
** ** * * ** * ** * ****** *** ** * * * * * * * *** * ** * * * * * **** = tmp;
* **** * * * * * ** *** ** ** ** * ** * * ** * * ***** * ** * * * ** tmp;
* * * * ** * * *
* ** *** * * ** ** *
}
int main(void)
{
int data[100] = {0};
for(i=0 ; i<size ;i++)
{
* *** **** **** * ** * * * ** *** , *** **** *
}
for(i=0 ; *** ******* ; i++)
* **** * * ****** * * ** * * , array[i]);
** * *** ****** * *
* ** ** *** * *** *
return 0;
}
answered
Jan 6, 2017
by
410223045
(
-194
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>
int main()
{
** * ** ** * * *** ** num, fibonNum;
* *** **** ** **** * * *** * ** ** &num);
* *** ***** * **** * * *** = fibonacci(num);
* * ** * * ** * *** ** * **** * * * * ** ** fibonNum);
***** * *** * * * ** * 0;
}
int fibonacci(int number)
{
* * * ** ** * * i, num1 = 1, num2 = 1, fibon = 0;
****** ** * * *** ***** <= 0)
* * ** * ** **
* * **** * ** **** * *** * *** ** *** * * * * * ** ** ** * ** *** * input positive numer");
* ********* * * * * ***** * ** * * * * * 0;
*** * * *** ***
***** *** * * ***** ****** * ** if((number == 1) || (number == 2))
* * ** **** *** ******** ** * ** ** * **** 1;
* * *** ** * ** ** *
** * * ** **** **** ** *
* * *** * ** * *** *** * *** *** = 3; i <= number; i++)
**** ** ** ** * * ** ** ** ** * * * **** *
******* ** **** * * * ****** **** * ** *** * * = num1 + num2;
** * * *** ** * * * *** ** * * * *** ** ***** * *** *** **** * * = num2;
* * **** ***** * ** * * * * ** ** *** ** ** * *** * * ** * ***** = fibon;
* * *** * **** ** * * * *** * ** * ** **
* *** ** ** * *
* *** **** * ****** * ** * * ** * fibon;
}
answered
Dec 1, 2016
by
lovekakoda
(
-64
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include ***** *** ** **
#include <math.h>
int main()
{
int i,a,num[100]={0},temp;
*** * * ** * ****
** ** * **
** ** * ** * *
* ** * *** * ***** * *** *** * * * * ** **
** ***** * ****
* ** * *** ** **
** *** ** * * ***
* *** *** *** ** * *
** ** ***** *** *** ** * * **
* * ** ** ***** *
*** * * * **
* ** ***** ****
** ** * * * ** **
* ** * * **** * * *** * *** * *
*** ****** * **
return 0;
}
answered
Dec 1, 2016
by
chen
(
-102
points)
ask related question
comment
Please
log in
or
register
to add a comment.
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
Nov 30, 2016
by
chen
(
-102
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 n);
int main()
{
* ** * *** * * *** ** * n;
** * * * ** ** ** &n);
* * ** * ** * *** * *** ** * data[n];
* ** ** * *** ** * i;
** ** ** * ** * ******* * = 0; i < n; i++)
** ***** * * ** *
**** ** *** * * * * * * * * * *** ** * * * ** ** ** ** *** * ** &data[i]);
* ** * *** * **
* * * * * * *** *** * *** n);
* * ** *** * = 0; i < n; i++)
** *** ** ***** * *
** ***** *** * * * **** * * * ** * * * * ** ** * ****** ",data[i]);
}
** * ** **** * * * ** ** * * **** * ** *
******* * * * * * * * * ** 0;
}
void reverse(int *array,int n)
{
* * *** * ** **** * * i,tmp;
* *** ** * * ** * ** % 2 != 0)
* ** * ****
* *** * * ** * *** ** *** * * ** = 0; i <= n/2; i++)
* ** * * ****** * ** * *** * * * * * * *
** ******* ** * ** * ** *** *** ** ** * * ****** ** **** ********* *** = array[i];
** ** * * * * ** **** *** ** * ** *** * ******* ** ** *** ** = array[(n-1)-i];
* * **** * * ** * *** * * * * * * *** * *** ** *** *** * * = tmp;
** ** * *** * ******* * * ** * *** *
* ** ** **** * * ** * *
* ******* * ** ** *****
{
***** ** ** *** * ** * ** * * * * * * * * = 0; i <= (n/2)-1; i++)
* ****** ** ** * ** * **** ** **** ** ** ** * * * *
* * * *** *** *** ** * ** * **** *** * * **** * * * ** ** * * = array[i];
* ******* * ** **** ** * **** *** ** *** ** * * ** * ** * = array[(n-1)-i];
* *** * *** *** **** * ** ** ** * * * *** *** ** ** * ** ** = tmp;
** *** * * * * * * * * ** *** *** ***** ***
* ** * * *** * ** ** *
}
answered
Nov 10, 2016
by
kyle wen
(
-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 <stdlib.h>
#define N 10
void reverse(int *array,int size);
int main()
{
int * ** * ** * ** * * * ** *
*** * ** * * ** * ** * * ***
* **** * * *** * ** ****** * * ***** * ** * ** *** * ** *
* * * *** ** ** ** **** ***
**** **** * **** * * ** * * * * *** * ** **** **
* ** * * ** **** ** **** * *** * **
* *** ** ***** * * * ** *** **** ** * * * * ** *
* *** ** * ** * * * ***** ** * * ***
***** * * * ** * ** 0;
}
void reverse(int *array,int size)
{
*** **** * * * ** **** * * * tmp,i;
*** ** * ** * * * * *** *** ***** ** * / 2;i++)
** ***** ** ** * * ***
** * ** ** * * *** * **** * ** *
** * * * * ** ** * ** **
* * * *** * * * ***** * * * ** ******
**** ** ********* * * *
}
answered
Nov 10, 2016
by
410214219
(
-284
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 i);
int main()
{
*** * * * ** ** **** * i,j,k;
* * * * *** ****** * ** ** ** * * *** * **
** ****** * ** * ** ** * array[i];
* *** *** ** ** * * * ** * * * ** *
** *** * **** ** ***** **** *** ** * ** * ** * * *
*** *** **** * ** ** *
* ** ***** * * *** **** **** *
* **** ** * ** * * * * ** * * **
*** ** ** * *
*** ** * * ** * * ** * ********** * * ***
**** ***** ** * *** ** 0;
}
void reverse(int *array,int i)
{
* ***** * **** * **** * * * l,tmp;
**** * ** * * * * * * *** * * ** **
*** * *** * ** * *********** ** **
** * * * **** * **** * * * * **
** ** * * * * * *** *****
** * * ** ** *** ** **
answered
Nov 10, 2016
by
andreas lu
(
-188
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include ** ** * * *
#include ********** * *
void reverse(int *array,int size);
int main()
{
* **** * ** **** * ** * data[5]={0};
*** ** * * ** *** * * * i;
* * ** ** **** ** * ** = 0; i < 5; i++)
** * * * *****
*** * ** ** * * ***** ** ** ***** * * ** * * ** * * * **** ** &data[i]);
* *** * * * * * **
* * ***** **** * ** * * * * 5);
* * * * * * * *** * ** = 0; i < 5; i++)
** ** * * * * ** * *
* ******* * ** * ** *** * * ** ** * *** *** * ** ** ",data[i]);
*** ** **** * **** * * *
** ** **** *** ** *** * ** *** * *** ** **
** *** ** *** *** * * * * * 0;
}
void reverse(int *array,int size)
{
* ** **** *** ** *** i,tmp;
*** ** ** *** * * * * ** * * = 0; i <= size/2; i++)
*** * ** * * ** ***
* * ** * ** ** ** * **** ** * ***** ** ** ** ** * = array[i];
* * * * * * * ** ** * * *** * ****** * ** * * = array[4-i];
* ** * *** * * ** * **** *** * * * * *** * * * * ** * * *** = tmp;
* * * * ** ** * * * ***** * *
}
answered
Nov 10, 2016
by
kyle wen
(
-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 <stdlib.h>
void reverse(int *array,int size);
int main()
{
** * ** * ** * ***** * *** array[3]={50,100,150},i;
* ****** * * *** * ** * * *
* ** ** ** *** ** ****** * * * **** * ** * * ** *
** *** ****** ** * *** ** ******
* * * * * * * * * ** *
**** *** **** ******** ** * ** ** ** * ** * * * * * *** *****
* * *** *** *** * * * ** * * *
** ** **** * * * * * 0;
}
void reverse(int *array,int size)
{
**** * ** ** * * * * * ** * *** tmp,i;
* * ****** * ** *** * ** ****** *** * * * *
* ** * **** *** * ** **
* * ** * ** ** * ** * *** * ** *** * ***
**** * * ****** * * ** *** * * * **
* ** * * * ** *** * ***** * *
* * ** * * **** ** * ******
}
answered
Nov 10, 2016
by
410214219
(
-284
points)
ask related question
comment
Please
log in
or
register
to add a comment.
Page:
1
2
next »
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English
中文
Tiếng Việt
IP:172.69.17.196
©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.8k
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
|
4.1k
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
|
869
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
|
2.1k
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.7k
views
12,783
questions
183,442
answers
172,219
comments
4,824
users