解题思路:

选择法排序

if (a<b) a=b;

if (a<c) a=c;

return a;


注意事项:
暂时不明
参考代码:

#include<iostream>

#include<iomanip>

using namespace std;

double max_return(double,double,double);

#define max_num(a,b,c) (a>b? (a>c ? a : c) : (b>c? b : c))

int main()

{

    double a,b,c;

    cin>>a>>b>>c;

    double max_number =  max_return(a,b,c);

    cout<<fixed<<setprecision(3)<<max_number<<endl;

    cout<<fixed<<setprecision(3)<<max_num(a,b,c)<<endl;

    return 0;

}

double max_return(double a,double b,double c)

{

    if (a<b) a=b;

    if (a<c) a=c;

    return a;

}


 

0.0分

0 人评分

  评论区

  • «
  • »