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

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

48 Answers

0 like 0 dislike
Hidden content!
#include<stdio.h>



#include<stdlib.h>



 



int X1(int num,int num2,int num3);

int X2(int num,int num2,int num3);



int main()



{



    int num,num2,num3;


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


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


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



    printf("%d %d",X1(num,num2,num3),X2(num,num2,num3));



    return 0;



}



 



int X1(int num,int num2,int num3)



{


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


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


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


*** ** *** *** * ******* * *** ****** * ** * * * ** *** * *** * * *** ** ***** * ** * num;


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


*** ** * **** **** ******** ** **** **** * * * ** ******* * ** * * * * **** * * *** * * * num3;


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



    else if(num2<num3)


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


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


* **** *** * * * *** ** **** * ** ** ** ******** * * **** ** *** * ******* *** ** **** *** **** * num2;


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


* * ** * * **** ** * * ** * * * *** *** * * ** * ****** ** *** **** * * **** **** ** *** * num;


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



    else



    {


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


* * * * * * * * * * * *** * * **** ** *** ** ** * ***** ** *** * * num3;


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


**** * * ** * **** * *** ********* ** * * * * * ** ** * ** ** * * * * ****** num2;



    }

}

int X2(int num,int num2,int num3)

{
**** * * * ** * * ***
* * * ** ** ** * * * ***** * * ** **
* * *** * **** *** * * **** ** ** ** *** ** * * ** ** * * ** ** * * * *
* * *** **** * * * *** ** * * * ** *** * ** * ** * * **** ***** *** * ** ** * * ***** * **** * num;
*** ** *** * ** * * *** * ** ** * ***** ****** ** *** * ** ****
** ** ** * ** *** * ***** * *** *** * *** ** *** ******* * ** ** *** * * *** * *** **** num3;
* * * * * ** ** *** * * **** * ** ** **

    else if(num2>num3)
**** ** *** ** * ** * * * * **** ** ** ****
** * * * ** * **** *** * ** ** * **** * * * * * * ** ** * ** * ** * *** **
* * ** * * * * ** *** ** * *** ** * ** ** * *** * ** * * ** ** * ** num2;
* * * * * * * *** * ** **** ** * * * *** * ****** * * *
*** * *** ** ** * ** * * *** *** * * * * *** * **** ** ********* ****** * *** * * **** num;
* * * * ** * * * *** * ** * * ******* * *

    else

    {
* * *** * ** **** * **** * **** *** * * ** * * *****
** * ******** ****** * * * *** * *** ***** * **** *** ** ***** **** *** num3;
* ** * *** * ** * *** * * ** * * *** * * *** **
**** * * * *** * * * ** * * ** ** * ***** ** * * * * ** **** num2;

    }

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



int ** * (int ** **** * ** *

{
**** * * num2 * * num3)
* * num3;

else
** **

}

int * (int **** *** *

{
* *** num2 ***** num3)
** *
***
** ** ***

}

int * *
* * * * *
*** ** ** * ** ** *** * ** **
** ** * ****** ** ** *
* * * ** * * * ** **
**** * * ** *** * numb, ****
* ******* ** ** * *** ** * ** *
* *** 0;

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

int main()

{
***** *** ** * * **** **** ** i, j, k, max, min;
* ** ***** *** ** * * * ***** ** **** ** &i);
* **** *** ** * * * * * *** ** &j);
* ** * * * *** * ** **** * * &k);
* * ** * * * * * * * ** *

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

    }
* * ** *** * ** ** *****
*** **** * * ** ** *
*** * * ** ** * ** ****** * ****** *** * * ** *
* ** **** * * ** *****
*** ** * ** ** * * ***
* * * * ** *** ** * * *
* * **** ** ** ** * * * * * ** * * ** * *
* * * ** ** ** **
*** *** * *** * * ** ** * **
* * * * * ** ** * * ***** *
* * ** * ** * * * ***** ** * * * ****
* * * *** ** *** ** ***
* *** * *** * * * * **
* * * * ** ** **** * *** *
** ** * ** * * ** * * *** ** * * **** *

    }
* ** *** * * * * * * * * *

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

    }
** * ** ** ** ****** **** ** * * * ", max);
** * *** ** * ** ***** * * *** ** * * * * * min);
** * ** * ** * * * * ** 0;

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

int main()

{
** * * ** *** * ***** i, j, k, max, min;
**** ** * * * * * ******* * * *** ** &i);
* *** * * ********* *** &j);
* * * * * ** * * * * ** * * &k);
*** * * * * * * * *****

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

    }
* * * ***** * * * ***** *
* * * * * **** * *** ***
* ******** * * ** ** ****** ** * *
******** ** ***** ****
* ** * * * ** *** * * ** *
* * *** * ** ** * *
**** *** * * * *** ** * * * * *** ** *** *
** * * * * * * * **
** *********** ***** * * ** *
* ** * * *** ****
** * **** * ****** * * * * ** * * *** ** * * **
* * * * ** * * ** *
* *** *** ** * *** **
* * * * * * ** **** *
* ***** ** ** ** * ** * ** ****** *** *

    }
*** * *** ****** ** ***

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

    }
*** * * * ** *** * * *** * **** * ", max);
**** ** * ** ** *** * ****** * * ** * * * * min);
* *** ** * * *** * ** **** *** 0;

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

#include<stdlib.h>

int f(int ,int,int);

 int main()

 {
** * ** * ****** ** **** * a,b,c;
** *** ** **** * * ** *** * %d * * ** *** * * * * * **
* ** ** * * ** ** * * ** * **


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

 }



int f(int a,int b,int c)

{


* ** *** * ** ** * * ** max,min;
* * ***** ****** ** ** * ** *

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

    }
*** * * * ** * *** * ***
* ** * * ***** * ** *
* *** * * *** ** * * * **** * *
* * * ** * *** *** *** * ****
* * * * * * * ** ****
* * ***** ** * *** * ***** * *
* * ** ** **** * *
* * * * ** * **** * *
* ** ** ** ** * ** ** **
***** ** **** * * ** ***
* * * * *** * *******
*** * ****** ** ****
** ***** ** ** *** * ** * ****


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



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

#include<stdlib.h>



 int main()

 {
** * * * * *** * a,b,c,max,min;
** * * * ***** * **** * * * %d ** * * ** * **** ** *
****** ** ***** * * ** ** *

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

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

    }
* *** ** * ***** * ** * *** *
*** *** ** * * * ** * * *
**** * * * * ** * * * **
* * * *** * * * *** **
** ** ** *** ** ** ****
* * *** * * ** * * ** * * *
* * **** ** * ** *
* ** ** ** *** *
** * * ** * * ** ** ** ****
*** ** * * **** * * ** * * ** ** ***


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

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



int ffff(int fa,int fb,int fc,int fx){

    if(fx==0){
*** * **** * * * ** *** ** ** ** *** * ** * ** * ****** ** || fc>fa){
** * ******* * *** ** ** ******* * *** * *** * * ** *
* * * ** * ***** * ** ** * * ****** ** * * *** * ***** * * * * * ** *** * * * * ** * * * * ** fb;
** ** * **** * ** ** * * *** *** ** *** * **** ***** * ** *
* * ** * * ** ** * * ** ******* * * ** ** * ** ******** * ** ** *
* * ** ** ** * *** * **** * ******* ***** * **** * ** ** * * * * * * ** * *** * fc;
** * * * * * * * * ** ** ** * * ** * * ** * * * ** ***
*** * * * *** * * * *** * * *** * * * **
* ** *** ** ****** * *** * * * * * * ** *** *** *
* * ** * * * ** **** * *** * * * ** **** * *** * * ****** * * fa;
** ** * ** * ** * ***** *** * ******

    }

    else{
** *** ** * * * ** ** * * ** * * * * **** *** * *** * ** * || fc<fa){
* ** * ** * ** * * * * ***** **** * ***** * * * *** * * * **** ** ** *** ***
** * * ******** ********* *** * * **** * **** **** * * ** ** ** * ** * ** **** ** fb;
** **** ** * ** ****** *** ** *** ** *** * *** ** ** *
* * * *** * * ** * * * * * ** * * ** *** * * * ***** * *
* * * * ****** ** ** * * * ** * * * * **** *** * *** * * * ** *** ** * ** * ***** ** fc;
* ** * * * * * **** **** * * ** * ** ** ** * * * ****** * * **
***** ** * * * *** ** * * *******
** **** * * ** * ** * * * * * ** ** ***** * **
* * ** * * * ** *** ** * ** * ** ** ** * * ** ** ** ** ** * * ** * ** fa;

        }

    }

    

}



int main(){

    

    int a,b,c;
* ** * ***** * * ** ** * * *** ** **** *
* * ** ****** ** ** ** ** ** * *** * * *** ***
** **** ***** * ** ** ****** * ***** ** * **

    

    return 0;

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



int main ()

{
* *** *** * * * ** ** i , k[3], m, x;


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

    {
***** **** **** * ** * * * **** * * ****** ** &k[i]);

    }
* ** * * * ** * * *** * *** *
** * *** * *** **** * * * *** * *

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


* * * ** * * * * * ** *** ** m);


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

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

    }
*** **** * *** * **** * ** ***** * x);


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

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


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


* * * ** * **


*



int bg(int a,int b,int c){


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


***** *** * ** *** * (a > b * * ** ** a > c)


** * ** * * * * * * * a;


** * *** * ******** *** if (b > a *** **** b > c)


**** ***** *** *** **** *** b;


*** * *** * ** **** * * * if (c > a * ** ** **** c *** b)


* ** ** ** * c;



}


*** *



int sm(int a,int b,int c){


* * ** * ** ***


* * ** ** ** ** *** (a * b *** *** * a * ** c)


*** ** ****** * * * ** * a;


** * ** ** ** * * * *** if (b * * a * * * **** b ***** c)


** ** ** * * ***** * b;


* ** ** ** ** * *** * * * * if (c ** a * ** c < b)


******** ** * ***** * * c;



}


*******



int main (void){


* * *** * * ** *


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


* ** * ** ** ** * * * ** * * %d ******** *** * ** * * ** * ** *


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


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


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


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


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



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


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


* * * * ** **** *


** * ***



int bg(int a,int b,int c){


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


* * * * * *** * ** (a > b * ** * * a > c)


**** *** ** * * *** **** * * a;


******* * * * *** * if (b > a * * ** ** * b > c)


**** ****** ** * *** ** ** b;


** *** **** **** * ** * * if (c > a * ** * * * c *** b)


* *** * * *** ** c;



}


** * *



int sm(int a,int b,int c){


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


** * *** * *** ** * * (a ** * * b **** *** ** a * ** c)


* ** ** * ** * * ** *** ** ** a;


****** * * *** ****** * * * **** if (b * * a *** ** b ** c)


* ** ** ** * ** * * * ** b;


* * **** *** *** * * ** ** if (c **** a * * * * c < b)


** ** ** * ** * * * * c;



}


***



int main (void){


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


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


* * * ** ** *** ** * * * ** **** ** %d * ** * *** *** *** ** * *** * *


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


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


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


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


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



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

Related questions

2 like 0 dislike
44 answers
[Exercise] Coding (C) - asked Nov 2, 2016 in 作業 by Shun-Po (18k points)
ID: 16861 - Available when: Unlimited - Due to: Unlimited
| 7.7k views
0 like 0 dislike
76 answers
[Exercise] Coding (C) - asked Oct 19, 2016 in 作業 by Shun-Po (18k points)
ID: 14120 - Available when: Unlimited - Due to: Unlimited
| 11.6k views
0 like 0 dislike
91 answers
[Exercise] Coding (C) - asked Oct 13, 2016 in 作業 by Shun-Po (18k points)
ID: 13617 - Available when: Unlimited - Due to: Unlimited
| 12.9k views
0 like 0 dislike
201 answers
[Exercise] Coding (C) - asked Oct 5, 2016 in 作業 by Shun-Po (18k points)
ID: 12293 - Available when: Unlimited - Due to: Unlimited
| 25.6k views
0 like 0 dislike
99 answers
[Exercise] Essay (Open question) - asked Sep 21, 2016 in 作業 by Shun-Po (18k points)
ID: 11341 - Available when: Unlimited - Due to: Unlimited
| 14.1k views
12,783 questions
183,442 answers
172,219 comments
4,824 users