标签:turn 详解 amp int copyright names 连接 code main
题目链接:http://ac.jobdu.com/problem.php?pid=1002
详解连接:https://github.com/Pacsiy/JobDu
参考代码:
// // Created by AlvinZH on 2017/4/24. // Copyright (c) AlvinZH. All rights reserved. // #include <iostream> #include <cstdio> #include <cmath> using namespace std; int main() { double P,T,G1,G2,G3,GJ,ans; while(~scanf("%lf %lf %lf %lf %lf %lf",&P,&T,&G1,&G2,&G3,&GJ)) { if(fabs(G1-G2)<=T) ans=(G1+G2)/2; else if(fabs(G3-G1)<=T&&fabs(G3-G2)>T) ans=(G3+G1)/2; else if(fabs(G3-G2)<=T&&fabs(G3-G1)>T) ans=(G3+G2)/2; else if(fabs(G3-G1)<=T&&fabs(G3-G2)<=T) ans=max(G1,max(G2,G3)); else ans=GJ; printf("%.1lf\n",ans); } return 0; }
标签:turn 详解 amp int copyright names 连接 code main
原文地址:http://www.cnblogs.com/AlvinZH/p/6759757.html