Đăng nhập để hỏi chi tiết
Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
#include <bits/stdc++.h>
using namespace std;
int main()
{
long double a,b;
cin>>a>>b;
vector<long double> cnt;
cnt.push_back(a+b);
cnt.push_back(a-b);
cnt.push_back(a*b);
cnt.push_back(a/b);
sort(cnt.rbegin(),cnt.rend());
for(long double i:cnt) cout<<fixed<<setprecision(6)<<i<<" ";
}
Hãy giúp mọi người biết câu trả lời này thế nào?
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b;
cin>>a>>b;
vector<double> kt={a+b,a-b,a*b,static_cast<double>(a)/b};
sort(kt.begin(),kt.end(),greater<double>());
for (double i : kt) {
cout<<fixed<<setprecision(6)<<i<<" ";
}
return 0;
}
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin