Viết hàm static Func<double, Func<double,double>> Discount() => rate => price => price * (1 - rate); và static Func<double,double> AddTax(double tax) => price => price * (1 + tax);. Trong Main, đọc 3 số thực rate tax price (cách nhau khoảng trắng, dùng CultureInfo.InvariantCulture). Tạo var d = Discount()(rate); và var t = AddTax(tax);. Tính double final = t(d(price));. In final với 2 chữ số thập phân theo InvariantCulture.
Một dòng chứa ba số thực rate tax price (dùng dấu chấm thập phân).
0 ≤ rate, tax ≤ 1, 0 ≤ price ≤ 10^6. Bắt buộc dùng curry Discount và partial AddTax.
Một dòng chứa giá cuối cùng với 2 chữ số thập phân (InvariantCulture).
Đang tải editor...