当前位置: 代码迷 >> 综合 >> 相加和最大值 oj
  详细解决方案

相加和最大值 oj

热度:31   发布时间:2024-01-14 23:14:13.0

相加和最大值

Time Limit: 1000MS  Memory Limit: 65536KB
Submit  Statistic
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;
}


  相关解决方案