sdut-1148 相加和最大值

点击打开链接

相加和最大值

Time Limit: 1000MS Memory Limit: 65536KB

Problem Description

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

Input

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

Output

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

Example Input

1 2 3

Example Output

5

Hint

Author

#include <iostream>
using namespace std;
int main()
{
	int a1,a2,a3,a,b,c;
	cin>>a1>>a2>>a3;
	a=a1+a2;
	b=a1+a3;
	c=a2+a3;
	int max;
	if(a>=b)
		max=a;
	else
		max=b;
	if(max>=c)
		cout<<max<<endl;
	else
		cout<<c<<endl;
	return 0;
}


/***************************************************
User name: YT1658506207邵雪源
Result: Accepted
Take time: 0ms
Take Memory: 204KB
Submit time: 2017-07-26 15:45:53
****************************************************/

原文地址:https://www.cnblogs.com/sxy201658506207/p/7586296.html