酷代码 AI
菜单
服务商

题目描述 现有变量 a、b、c、d,已知四个变量的数值,现在需要求出算式 的结果。 输入 输入为一行分别为变量a,b,c,d的数值。 输出 输出为1行,为结果 样例输入 复制 1 2 6 2 样例输出 复制 12

```python # 计算矩形周长和面积 length = float(input()) width = float(input()) perimeter = 2 * (length + width) area = length * width print(f"{perimeter:.2f}") print(f"{area:.2f}") ``` ```python # 计算盒子总数 a, b, c = map(int, input().split()) total = a + a * b + a * b * c print(total) ``` ```python # 计算表达式 (a + b) * (c - d) 的结果 a, b, c, d = map(int, input().split()) result = (a + b) * (c - d) print(result) ``` [2025-12-15 17:55:54 | AI问答 | 149点数解答]

相关提问
发财导航,免费问AI
实用工具查看更多