题目描述
编写一个程序,输入a、b、c三个值,输出其中最大值。
输入格式
一行三个整数,分别为a、b、c。
输出格式
a、b、c 中的最大值。
输入数据 1
10 20 30
输出数据 1
30
数据范围与提示
数字 a、b、c 都在 int 范围内。
代码
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,max;
scanf("%d%d%d",&a,&b,&c);
if(a>b)
max=a;
else
max=b;
if(c>max)
max=c;
printf("%d",max);
return 0;
}