相加和最大值
Time Limit: 1000MS
Memory Limit: 65536KB
Problem Description
输入三个整数a,b,c。并进行两两相加,最后比较相加和的最大值。
Input
输入数据包含三个整数,用空格分开。
Output
输出两两相加后的最大值。
Example Input
1 2 3
Example Output
5
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c,d,e,f;
scanf("%d %d %d",&d,&e,&f);
a = d + e;
b = d + f;
c = e + f;
if(a < b)
{
if(b < c){
printf("%d",c);
}else{
printf("%d",b);
}}
else{
if(a < c){
printf("%d",c);
}else{
printf("%d",a);
}
}
return 0;
}