#include <iostream>
#include <iomanip>
using namespace std;
float a = 0;
float b = 0;
float res = 0;
int main()
{
cin >> a >> b;
if (0 == b)
{
cout << a << "/" << b << "=" << "Error" << endl;
}
else if (b < 0)
{
cout << a << "/" << "(" << b << ")" << "="
<< setiosflags(ios::fixed) << setprecision(2) << a / b << endl;
}
else
{
cout << a << "/" << b << "="
<< setiosflags(ios::fixed) << setprecision(2) << a / b << endl;
}
return 0;
}
PTA - L1-037 A除以B
最新推荐文章于 2024-08-09 10:25:03 发布