输入三个整数a,b,c,输出其中的最小值。 【样例输入】 红色部分为键盘输入 input a,b,c:4,3,5
时间: 2023-08-22 18:06:34 浏览: 38
好的,我的回答是:
```python
a, b, c = map(int, input("input a,b,c:").split(","))
print(min(a, b, c))
```
输出结果为:
```
3
```
相关问题
从键盘输入三个整数 a、b、c,输出其中最大的数。
可以使用以下代码实现:
a = int(input("请输入整数a:"))
b = int(input("请输入整数b:"))
c = int(input("请输入整数c:"))
if a >= b and a >= c:
print("最大的数是:", a)
elif b >= a and b >= c:
print("最大的数是:", b)
else:
print("最大的数是:", c)
从键盘输入三个整数 a,b,c,输出其中最大的数。
您好,我可以回答您的问题。请看以下代码:
#include <stdio.h>
int main()
{
int a, b, c, max;
printf("请输入三个整数:");
scanf("%d%d%d", &a, &b, &c);
max = a;
if (b > max)
max = b;
if (c > max)
max = c;
printf("最大的数是:%d", max);
return ;
}
以上代码可以实现从键盘输入三个整数 a,b,c,输出其中最大的数。希望能对您有所帮助。