From 7321d1de165ecf7973796c913088a5e7aed4bc20 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Sun, 1 Aug 2021 19:36:54 +0800 Subject: [PATCH] =?UTF-8?q?672.=20=E7=A8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/6826847/ --- AcWing/672/672.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 AcWing/672/672.cpp diff --git a/AcWing/672/672.cpp b/AcWing/672/672.cpp new file mode 100644 index 00000000..e1e42259 --- /dev/null +++ b/AcWing/672/672.cpp @@ -0,0 +1,18 @@ +#include + +using namespace std; + +int main() { + double x; + cin >> x; + if (0.00 <= x && x <= 2000.00) { + cout << "Isento" << endl; + } else if (2000.01 <= x && x <= 3000.00) { + cout << "R$ " << fixed << setprecision(2) << (x - 2000.00) * 0.08 << endl; + } else if (3000.01 <= x && x <= 4500.00) { + cout << "R$ " << fixed << setprecision(2) << (1000.00 * 0.08) + (x - 3000.00) * 0.18 << endl; + } else { + cout << "R$ " << fixed << setprecision(2) << (1000.00 * 0.08) + (1500 * 0.18) + (x - 4500) * 0.28 << endl; + } + return 0; +}