竞赛
考级
法兰西玫瑰
#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
基本框架写好,定义判断最大值函数,再定义求函数值的函数,主程序里输入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八十——八十!八十!
#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; }
Ysjt | 深 ™
嫌疑を避ける ~~
JMZ詹总
黑客_天之神_ZDZL_zsy
阿基米哲V(^-^)V
有事找大号