编程C语言程序,实现如下功能:从键盘任意输入3个整数,求出3个数中的

编程C语言程序,实现如下功能:从键盘任意输入3个整数,求出3个数中的最大值,并且显示在界面上,注意编程规范,要求输入和输出时应该添加必要的提示

#include <iostream>
using namespace std;
int main()
{
int a,b,c;

int max;

cout<<"请输入三个数";

cin>>a>>b>>c;

if(a>b)

{

max = b;

if(c > max)

max = c;

}

else

{

max = a;

if(c > max)

max = c;

}

cout<<"最大值是"<<c<<endl;

return 0;

}
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答