相加和最大值

来源:互联网 发布:软件故障处理要求 编辑:程序博客网 时间:2024/06/05 03:24

Problem Description

输入三个整数a,b,c。并进行两两相加,最后比较相加和的最大值。

Input

输入数据包含三个整数,用空格分开。

Output

输出两两相加后的最大值。

Example Input

1 2 3

Example Output

5



#include<stdio.h>
int main()
{
int a,b,c,d,e,f,max;
scanf("%d%d%d",&a,&b,&c);
d=a+b;
e=a+c;
f=b+c;
max=d;
if(e>d) max=e;
if(e>f) max=e;
else if(f>d) max=f;
printf("%d\n",max);
return 0;
}

0 0
原创粉丝点击