解题思路:
用了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 人评分
C二级辅导-统计字符 (C语言代码)浏览:744 |
C语言训练-求s=a+aa+aaa+aaaa+aa...a的值 (C++代码)(手动优化一下计算)浏览:1284 |
C语言训练-求具有abcd=(ab+cd)2性质的四位数 (C语言代码)浏览:566 |
A+B for Input-Output Practice (IV) (C++代码)浏览:677 |
求圆的面积 (C语言代码)浏览:1271 |
计算质因子 (C++代码)浏览:1642 |
字符串的输入输出处理 (C语言代码)浏览:944 |
printf基础练习2 (C语言代码)浏览:741 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:584 |
WU-链表数据求和操作 (C++代码)浏览:1316 |