12 条题解
-
-1
#include #include using namespace std; int main() { float a, b; char c; cin >> a >> c >> b; if (c == '+') { cout << fixed << setprecision(2) << a + b; } else if (c == '-') { cout << fixed << setprecision(2) << a - b; } else if (c == '*') { cout << fixed << setprecision(2) << a * b; } else if (c == '/') { if (b != 0) { cout << fixed << setprecision(2) << a / b; } else { cout << "No Answer."; } } else { cout << "No Answer."; } return 0; }
信息
- ID
- 859
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 8
- 标签
- 递交数
- 2025
- 已通过
- 358
- 上传者