解题思路:
用了if语句
注意事项:
要写两个cout << fixed << setprecision(3) << a << endl;
参考代码:
#include<bits/stdc++.h>
using namespace std;
int main()
{
double a, b, c;
cin >> a >> b >> c;
if(a > b && a > c)
{
cout << fixed << setprecision(3) << a << endl;
cout << fixed << setprecision(3) << a << endl;
}
else if(b > a && b > c)
{
cout << fixed << setprecision(3) << b << endl;
cout << fixed << setprecision(3) << b << endl;
}
if(c > b && c > a)//&&表示看查是否两个选项是真
{
cout << fixed << setprecision(3) << c << endl;
cout << fixed << setprecision(3) << c << endl;
}
return 0;
}
0.0分
2 人评分