你说找不到错误?这些你都考虑了吗?==>多组数据、星期五和其他区分吗、满200才减20、优惠券内的汽油不打折
#include <stdio.h>
int main()
{
int t, x;
float y;
float order, discount, coupon, payment;
scanf("%d", &t);
while (t--)
{
discount = 0;
coupon = 0;
scanf("%d", &x);
scanf("%f", &y);
order = (8.38 * y);
if (order >= 200)
coupon = 20; // 满200减20
if (order >= 200)
y = y - (200 / 8.38); // 优惠券内购买的汽油不享受折扣
discount = y * 0.3;
if (x == 5)
discount += y * 0.1; // 周五额外优惠1毛
payment = order - discount - coupon;
printf("Order amount: %.2f\n", order);
printf("E-coupon discount amount: %.2f\n", coupon);
printf("Discount amount: %.2f\n", discount);
printf("Payment amount: %.2f\n", payment);
}
return 0;
}