您的位置:首页 > 其它

第七周项目3(2)求三数最大值

2014-10-12 10:56 183 查看
/*
 *Copyright (c) 2014, 烟台大学计算机学院
 *All rights reserved.
 *文件名称:week7-project3(2).cpp
 *作者:翟兴雷
 *完成日期:2014年 10 月 12 日

 *版本号:v1.0

 *

 *问题描述:输入三个整数a,b,c,输出其中最大值max

 *输入描述:三个整数,任意大小

 *程序输出:一个整数,代表三者最大值

 */
 

#include <iostream>

using namespace std;

int main()

{

    int a,b,c,max ;

    cout << "请输入三个正整数:" << endl ;

    cin >> a >> b >> c ;

    if (a >= b)

    max = a ;

    else max = b;

    if (c >= max)

    max = c ;

    else max = max ;

    cout << "三者最大值是" << max << endl;

    return 0;

}

运行结果:



总结心得:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: