酷代码 AI
菜单
服务商
DeepSeek字节豆包讯飞星火
更多选项

C语言实现:根据邮件重量与加急选项精准计算邮费

```c #include <stdio.h> int main() { int weight; char isUrgent; scanf("%d %c", &weight, &isUrgent); int fee = 8; if (weight > 1000) { int extraWeight = weight - 1000; fee += (extraWeight / 500 + (extraWeight % 500!= 0)) * 4; } if (isUrgent == 'y') { fee += 5; } printf("%d\n", fee); return 0; } ``` ######[AI写代码神器 | 149点数解答 | 2024-11-03 15:11:34]

相关提问
本站限时免费提问中
实用工具查看更多
Linux在线手册 [开发类]
Jquery在线手册 [开发类]
今日油价 [生活类]
图片互转base64 [开发类]
时间转换器 [开发类]