第7周项目3求3个数的最大值

来源:互联网 发布:sql漏洞检测工具 编辑:程序博客网 时间:2024/04/29 19:16

/*

*  Copyright (c) 2014,烟台大学计算机学院

*All rights reserved.

*文件名称:test.cpp

*作者:侯鑫行

*完成日期:2014年 10月 9日

*版本号:v1.0

*

*问题描述:输入3个正整数,输出其中的最大值

*输入描述:3个正整数

*程序输出:1个正整数

*/

#include <iostream>


using namespace std;


int main()
{
 int a,b,c;
 cout<<"请输入3个整数:";
 cin >>a>>b>>c;
 if(a<b)
    a=b;
 else
    a=a;
 if(a<c)
    a=c;
 else
    a=a;
 cout<<"最大为"<<a;
    return 0;
}

0 0
原创粉丝点击