以下是使用 C 语言解决此问题的代码: ```c #include <stdio.h> int main() { int a; char b, c; double price; scanf("%d %c %c", &a, &b, &c); switch (b) { case '90': price = 6.95; break; case '93': price = 7.44; break; case '97': price = 7.93; break; default: printf("Invalid gasoline type!\n"); return 0; } double total_price = a * price; if (c =='m') { total_price *= 0.95; } else if (c == 'e') { total_price *= 0.97; } else { printf("Invalid service type!\n"); return 0; } printf("%.2lf\n", total_price); return 0; } ``` [2024-11-01 10:09:36 | AI写代码神器 | 255点数解答]