c語言代碼編程題匯總:找出三個資料中最大的數值

來源:互聯網
上載者:User

標籤:class   nbsp   顯示   stdio.h   clu   inpu   logs   資料   c++   

 

找出三個資料中最大的數值

  程式碼如下:

 

 1 /* 2     2017年3月9日12:04:37 3     功能:找出三個資料中最大的數值 4 */ 5 #include"stdio.h" 6  7 int fun(int,int,int); 8  9 int main()10 {11     int a ,b,c;12 13     printf("please input three number: \n");14 15     scanf("%d %d %d",&a,&b,&c);16 17     printf("the maxium number is %d\n",fun(a,b,c));18 19 }20 21 int fun(int a,int b,int c)22 {23     if(a-b > 0 && a -c >0)24         return a;25     else if(b-a > 0 && b - c > 0)26         return b;27     else 28         return c;29 }30 /*31     總結:32     在VC++6.0中顯示的結果:33     ————————————————————34     please input three number:35     23 45 6736     the maxium number is 6737     ————————————————————38 39 */

 

c語言代碼編程題匯總:找出三個資料中最大的數值

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.