任意三个数求最大值

来源:互联网 发布:自然堂淘宝 编辑:程序博客网 时间:2024/05/01 15:44

/* 

 * Copyright (c) 2011, 烟台大学计算机学院
* All rights reserved.
* 作    者:高古尊
* 完成日期:2013 年10  月8  日
* 版 本 号:v1.0 
* 样例输入:12 45 32
* 样例输出:最大值是45
*/ 
#include <iostream>
using namespace std;
int main()
{
 //写下你的代码
   int a,b,c,d;
      cout<<"请输入a、b、c的值:";
   cin>>a>>b>>c;
      if(a>b)
d=a;
     else
  d=b;
   if(d>c)
  cout<<d;
   else
  cout<<c;
     cout<<"\n";
      return 0;
}