竞赛
考级
法兰西玫瑰
#include <bits/stdc++.h> using namespace std; int max3(double a,double b,double c) { if(a>b&&a>c) return a; if(b>c) return b; return c; } int main(){ double a,b,c,m; scanf("%lf%lf%lf",&a,&b,&c); m=(double)max3(a,b,c)/(double)max3(a+b,b,c)/(double)max3(a,b,b+c); printf("%.2lf",m); return 0; }
Voldemort
一坨江
#include <iostream> #include <iomanip> using namespace std; int f(int a,int b,int c) { double m=max(max(a,b),c); double n=max(max(a+b,b),c)*max(max(a,b),c+b); m=m/n; cout<<fixed<<setprecision(2)<<m; } double x,y,z; int main() { cin>>x>>y>>z; f(x,y,z); }
孟琪峰
qi
Maximus
#include<bits/stdc++.h> using namespace std; typedef double D; D maxi(D a,D b,D c){ if(a>b and a>c) return a; if(b>a and b>c) return b; if(c>a and c>b) return c; } D m(D a,D b,D c){ return maxi(a,b,c)/(maxi(a+b,b,c)*maxi(a,b,b+c)); } int main(){ D a,b,c; cin>>a>>b>>c; cout<<fixed<<setprecision(2)<<m(a,b,c); return 0; }
回来看看
JMZ詹总
基本框架写好,定义判断最大值函数,再定义求函数值的函数,主程序里输入ABC,带入求值就搞定了 求最大值 double ***(double a,double b,double c) { if (a > b) { if (a > c) { return a; } else { return c; } } else { if (b > c) { return b; } else { return c; } } } 求函数值 double f(double a,double b,double c) { return max(a,b,c) / (max(a + b,b,c) * max(a,b,b + c)); }
WA四十AC八十——八十!八十!
Ysjt | 深 ™
zsy
AC坤
EASY!!
PDC·[徐皓明]
阿基米哲V(^-^)V
#include<iostream> #include<cmath> using namespace std; int main() { double a,b,c,z,m1,m2,fm,m; cin >>a>>b>>c; z=max(a,max(b,c)); m1=max(a+b,max(b,c)); m2=max(a,max(b,b+c)); fm=m1*m2; m=z/fm; printf("%.2f",m); return 0; }
136****5500
LS_YZY
有事找大号