0 like 0 dislike
2.5k views
請設計一程式,使用者會輸入三個正整數,請找出其中最大及最小的數然後輸出。

請利用函數的方式來完成這個作業
[Exercise] Essay (Open question) - asked in 作業 by (18k points)
ID: 16958 - Available when: Unlimited - Due to: Unlimited
| 2.5k views

31 Answers

0 like 0 dislike
Hidden content!
#include * * * *



int max(int num[3])

{
** * ** ** *** ** * * i ;
* * ** * * ** * * * * **

{


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



return 0;



}



int min(int num[3])

{
** * * * ** * * * **** * i;
*** **** ****

{
** *** * * **

num[0]=num[i];}
**** **** *** *****



return 0;



}

int main()

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


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

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

#include<stdlib.h>

int big(int num[3]);

int small(int num[3]);

int main()

{
** *** * *** * ** *** ** * * num[3],i;
* * *** * * * * * * * **** ** * *
** *** *** *** * * **** * * **** * *** ** * ** ** *
*** ***** ****** ** *** * * ** *** * * **    
* *** * * * * ** * * * ** ** * * ** ** ** * **    
** * *** * ** * * *
** * ** *** ** *** * ** * ** ** * *
*** * * *** * *** 0;

    

}



int big(int num[3])

{
*** * *** * * * * * * i,j,k;
* **** *** * * ** * ***** * *
* * * *** * ** *** * ** * * * ** ** ** ** ***
* * **** * ** * * * ** ****** * * * ** * ** * * * ***
* ** * * ** ** **** * ** *** ** ********** *** **** ***** * ** ** *
** **** ** *** *** ** * * ** * **** * * * ******* *** *** * ****
* * * * ** * *** * ** ** * * * ** ****** * * ** *** **** ** * *

**** * * *** ** *** ** * * ** * num[0];

}   



int small(int num[3])

{
* * ********* * * ** i;
* * * ** ** *** * ** *******
*** * ** ** ** *** * ** ** * * * ** ** *** *** *
* ** ** ** *** * * **** *** *** ** * * ** **** **** * ** ** *
* * * ** **** * * * ** ***** * *** * ** **** * *** *
* * * **** * * * * ** * **** * num[0];    

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

#include<stdlib.h>

int big(int num[3]);

int small(int num[3]);

int main()

{
* *** ***** * * * num[3],i;
* * *** * ** * *** ******** ** * ** * *
* ** *** * ** *** * * ***** * * * * * *** *** * * ** ** * *
** * *** * * * *** *** ***** **** ** ****    
*** * ** * * ** * *** * * * * * ** ***** ***    
* * *** * * * *
** * ** * ** * **** * * * * * **
*** ***** * * ** ** * * ** * 0;

    

}



int big(int num[3])

{
*** * * * * ***** i,j,k;
** * * * ** ** * * * **
** ** * ** * ** * ** * * * ** * * ** *** * * *
* ******* ** ** **** *** * ***** * ******* ** ** * * * **
*** ** * ** **** *** ** * * * * *** * **** * * ** *
*** * * ** ** **** ** * ** * ** * ** * * ******** * ******** *
** **** * * * *** * ** ** ***** ** *** * * * *** *

* * *** ** *** ** ** * * *** num[0];

}   



int small(int num[3])

{
* *** * ** ***** **** ** i;
* ** * **** ** * * * ** * * **
* *** * *** * * * * ** * ** *** * ** * *** *
** * *** ** * * ** *** * * * ******* * *** ** * * * ** ** * *
** ** * ** ***** * ** * ** * * *** ** * * ******* **** **** *
** * * * * * * *** * ** ** * num[0];    

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

#include<stdlib.h>

int big(int num[3]);

int small(int num[3]);

int main()

{
* * ** ** ** ** * num[3],i;
***** ** *** ** * ** **** ** ***
* **** *** ** * *** * ** ** * * ** ** **** *** ** ** * *** *
*** ** * ** * * * *** ** *    
* * * ** * **** ** * * ** ** **** ** ** **    
* * ** ** * **
** * **** * *** *** *** ***** ** ********
* ** *** * ** * * * 0;

    

}



int big(int num[3])

{
* * * ** * *** **** *** * i,j,k;
* * * * * ***** * * **** * * * **
* * ** *** * ** *** * * * **** * * * *****
* * ****** ** * * ***** * * ** * ** ** *** ** * ** * * * * ** *
** ***** * * ** * * ** * ** * * ******* *** ** * ***** * *** * *****
** ** * ***** ** * * * ** ** ***** * * *** * * **** ** * ****
* ******* ** *** *** ** ** ** * ** * * ***** ** *

*** * * *** *** ** ** ***** * * num[0];

}   



int small(int num[3])

{
* ** * ** * ** ** * * * *** i;
** * ** * *** ** * * * * **** **
*** * ** * ***** ** * ** * *** ** ** * * **** * **
** ** **** ** ** * *** *** * * ***** ** * ** * *** *
* *** ** *** ** * * *** *** * ** *** ** ** *** **** *
** ** ** * * * *** * * ** * ** num[0];    

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

#include * **** **** **



int findBiggest(int num1,int num2,int num3)

{
* * * ** *** *** ** ** numT;
* * * * **** * * (num1 > num2)
* *** ****** * * * * *
****** * ** ** ** * * *** *** **** ** * * *** * **** = num1;
* **** * ** * * * ** * ** * * = num2;
* * ** * * ** *** * *** ** * * * * * = numT;
** ** * * * * ** ***
*** *** * ** * ** ** *** * (num2 > num3)
** *** *** * * *
* * ** * * * ** **** *** ** ** *** = num2;
***** * ** * * ** * * *** * * * * *** *** ** * = num3;
* *** *** ******** ** * * * ** *** ****** = numT;
* ******** *** * * *
* * * ** * * *** * * * num3;

}



int findSmallest(int num1,int num2,int num3)

{
* * **** * ** ** ****** *** numT;
* **** ** **** (num3 < num2)
* * * * * ** ** *****
* **** * **** * * * * * * **** ** * ** ** * = num3;
* *** ****** ***** * ** * ** *** **** = num2;
* * *** * * * *** ** * ** * ** *** * * ** *** = numT;
* ** **** ** ** * * **
***** *** ******* *** * * (num2 < num1)
****** * * *** ****
* **** *** *** ** ** *** * ** ** ** ** ** = num2;
*** * * * *** ***** * *** * ** *** *** * * = num1;
**** ****** *** *** ** ***** * * * * **** *** = numT;
* **** **** * ** **
*** * * * **** *** ** num1;

}



int main()

{
** ** *** * num1, num2, num3, biggest, smallest;
** ** * *** ** ******* *** * * * ***** *** &num1);
* * * * * *** * * * ********* **** * ** ** *** &num2);
** *** *** *** * * * * * ***** * *** ** * * &num3);
* * * * ** * *** ** = * *** num2, num3);
*** * * ** * ** ***** = * * * * num2, num3);
** * ** ** * * ** * * ***** ** *** = %d, Smallest = %d", biggest, smallest);


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

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

int big(int num1,int num2,int num3);

int **** * num1,int num2,int num3);

int main()

{
**** *** *** * **** *** ** * ** ***** *
*** * * ** *** ***** ****** %d *** * ** * * ** ** * ** * *******
* ***** *** * * * *** *** * * * ** * * ****** ***
* * ** ** * * ** * *** *** ** ** *** ** * ** ** *
***** * * * ** **** ** * * ** * **
* ** ** * ****** * ** 0; * *

}



int big(int num1,int num2,int num3)

{
***** ** ***** * * ** * * * num2 * * ** num1 > num3)
** * ** * * * * **** * * ** * num1;
* ** *** * * ** * ** ** if(num2 * * num1 ***** * ** num2 **
*** ** ** ** * * * **** * * ** *** * num2;
**** ** **** *** ** ** if(num3 * num1 * * num3 * num2)
* ** * ** * * * * * * * **** ** ** * num3;

}

int * * * * ** num3)

{
* **** ** * * * * **** * num2 ** ** * num1 ** ** num3)
* * * * ******* *** ** **** ** * * * ***** num1;
*** **** **** ** *** * if(num2 ** num1 *** ** num2 ** num3)
* *** * ** ** * * * ** ** *** ** num2;
* * ** ** * * ***** * ** if(num3 < num1 ** **** num3 < num2)
*** *** ** *** ** *** *** * * *** ** ***** num3;

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

int big(int num1,int num2,int num3);

int ** num1,int num2,int num3);

int main()

{
**** * * * * * * * * * * *
**** * * ** * * ** * * ** ** ***** %d * ** * ** * *** * ******* * * ** **
* ** * * * ***** * * * ** ** ** ***** ** * * ** * * * **
******* * * ** * **** * ** ** * * * ** ** ** * * ****
** **** * * * * ** * **** * *** * ** * *
* * * ** * ******* ** * 0; * *

}



int big(int num1,int num2,int num3)

{
* * ** ** * ***** ** * * * > num2 *** *** *** num1 > num3)
* * * ** ** * * ** ** ***** **** *** ** num1;
** * * ** * ***** * *** if(num2 ** * num1 **** **** num2 * *
* * ** ** * * * * * ** * ** ** num2;
* * ** *** * ** ** ***** if(num3 num1 * * * * num3 * *** num2)
** * ** * * * *** *** * ** * **** * * num3;

}

int ***** **** * *** num3)

{
** ** *** * * * * ** * ** * ** num2 * ** **** num1 *** num3)
** *** **** * *** * * *** * * ** *** ** num1;
* **** ****** ** * * **** if(num2 * * num1 ** ** * *** num2 * * num3)
*** ** ****** * * **** **** * **** * * * * num2;
* * ** *** **** ** if(num3 * * num1 ** **** ***** num3 *** * num2)
* * ** * * *** *** *** ** * ** *** num3;

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

#include <stdlib.h>



int biggest (int i1, int i2, int i3);

int smallest (int i1, int i2, int i3);



int main ()

{
* **** * ** * ** * ** i1=0,
**** * * * **** *** ***** ** ** * ***
* ** *** * * * *** ** **** ** ** **** * * * *
** * ** * *** *
* * * ****** * * * * **** ** * *** * ** * * **** * *
* * ** ** *** * * ** ** * ** * ** * *** ** *
** * * **** ****** * ****** * * ** *** * * * *
* *** * * * *****
* *** * ******* * * ***** * * ** *
** ** ** ** ** ** *** 0;

}



int biggest (int i1, int i2, int i3)

{
*** ******* * * ** b=0;
* ** **** * * ***** *
** * * *** ***** * * (i1>i2)
** *** *** ***** *** * ** * *** * * ** = i1;
* ** ** * ** * * *
*** * ** * * ***** * * * *** * * * = i2;
*** * * *** * ** *
** ** ** * **** * ** (i3 > b)
* * *** ** * *** * * * * = i3;
** ** ****** * ***** ***
*** ** **** ** * *** b;
* * ** * * **

}



int smallest (int i1, int i2, int i3)

{
** * *** ** * ** ** * s=0;
* * *** * **** * ** * *** *
** * * ** * ***** * * * (i1 < i2)
** * * *** *** * ** *** ** ***** *** = i1;
** ** * **** * * * ***
* ** * * * ** * *** ** ** * ** * ** * = i2;
**** * *** * * *
* * * ** *** ** * * *** (i3 < s)
*** * ****** * **** * ** * * ******** * = i3;
*** **** *** ** ** *
* * ** ** * ** *** * s;

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

#include<stdlib.h>



int big(int num)

{    
*** * * ** * *** * * * ** ** a,b,c,i,j;
** ** ** * * * ** **** * * ** ***** %d %d",&a,&b,&c);
* ****** ** ** * * *******
** **** ****** * ** * * * * ** * ** **
* ** * * ** ** * * * * * * * = a;
* ** ** * * *** ** * *** ***
** * * * * ** *** * = b;
* *** * ** * * * * ****
** * * *** *** * * ** * **
* *** ** ** * ***** * * * = i;
* * ** ** ** ** **
** ** * **** **** * **** * = c;
* ** *** ** ** *
* * *** ** * ** * ***** ** j;

}

int small(int num)

{    
* * ** ** *** * * ** a,b,c,i,j;
* * * * * ** *** ** * ** ***** %d %d",&a,&b,&c);
* *** * **** * ** ****
** * ** * * **** * ******** ** **
*** ********* * ** * * = a;
* ** ** ** ** ** ***
* * * * * * *** ***** * * = b;
* **** ** **** ** **** *** * *
*** * *** * ** *** * ** ****** *****
* ****** * * * ** * ** * = i;
*** * * * **** * *** * * *
** ** ** ***** ** * **** *** = c;
** ** **** * * *** ** ***
*** ** **** ** * *** * * * ** * * j;

}

int main()

{
** * ** ***** * * *** ** * * *** num;
*** * * ** ***** **** ** ** * * *** %d",big(num),small(num));
* *** ****** ** ** * ** * *
****** ** * *** *** * * ** * ***** * *
* ** ** ** * ** ** ** *** 0;

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

int main()



{
* * * ** ** * a,b,c;
* * *** * * *** * %d *** **** * * *** * *
* * ** ** ** ** ** ** **** * ***** a>c)
* ** * * * ** * ** * ** ** * * * * ***
* ** * ***** * * *** if(b>a *** * * * b>c)
* *** * * * ** * * * * ** * ****
** **** *** ** *** if(c>a * * *** * c>b)
* ** *** ***** * * ** * * ******* * * ***


**** * ***** ** * ** * *** ** a<c)
* * *** ** *** * *** ** ***** * %d",a);
* ** * * * * *** if(b<a * * * b<c)
* * ** * * ************* %d",b);
** *** * ** * if(c<a * **** ** c<b)
* ** * ******* ** *** * * %d",c);


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



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

Related questions

0 like 0 dislike
26 answers
[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
31 answers
[Exercise] Coding (C) - asked Oct 20, 2016 in 作業 by Shun-Po (18k points)
ID: 14582 - Available when: Unlimited - Due to: Unlimited
| 2.4k views
0 like 0 dislike
159 answers
[Exercise] Coding (C) - asked Sep 29, 2016 in 作業 by Shun-Po (18k points)
ID: 11639 - Available when: Unlimited - Due to: Unlimited
| 10k views
0 like 0 dislike
47 answers
[Exercise] Essay (Open question) - asked Sep 22, 2016 in 作業 by Shun-Po (18k points)
ID: 11533 - Available when: Unlimited - Due to: Unlimited
| 3.2k views
0 like 0 dislike
54 answers
[Exercise] Coding (C) - asked Oct 20, 2016 in 作業 by Shun-Po (18k points)
ID: 14583 - Available when: Unlimited - Due to: Unlimited
| 3.8k views
12,783 questions
183,442 answers
172,219 comments
4,824 users