```c #include <stdio.h> int main() { float hours, cost; printf("请输入每月上网小时数: "); scanf("%f", &hours); if (hours <= 10) { cost = 30; } else if (hours < 50) { cost = 30 + (hours - 10) * 3; } else { cost = 30 + 40 * 3 + (hours - 50) * 2.5; } printf("该月总的上网费用为: %.2f元\n", cost); return 0; } ``` [2024-12-03 19:38:16 | AI写代码神器 | 173点数解答]