11智能在线
新记
写程序:键盘输入a,b,c 3个值,输出其中最小者,写规范?
谢谢
举报该文章
其他看法
第1个回答 2020-03-06
#include<stdio.h>
int main() {
int a,b,c,t; printf("请输入三个数");
scanf("%d %d %d",&a,&b,&c);
if(a<=b) {
t=a;a=b;b=t;} if (b<=c)
{t=b;b=c;c=t;}
if(a<=b) { t=a;a=b;b=t;}
printf("%d,%d,%d\n", a,b,c);
return 0; }
第2个回答 2020-03-06
可以用
c语言
写一个很简单的
#include<stdio.h>
int main()
{
int a, b, c, temp;
scanf("%d %d %d", &a, &b, &c);
if(a>b){
temp=a; a=b; b=temp;
}
if(b>c){
temp=b; b=c; c=temp;
if(a>b){
temp=a; a=b; b=temp;
}
}
printf("%d", a);
return 0;
}本回答被提问者采纳
第3个回答 2020-03-06
Private Sub Command1_Click()
a = CInt(InputBox("请输入一个整数:"))
b = CInt(InputBox("请输入第二个整数:"))
c = CInt(InputBox("请输入第三个整数:"))
If b < a Then a = b
If c < a Then a = c
MsgBox ("最小值=" & a)
End Sub
相似回答
大家正在搜
相关问题
C语言,编写一个程序,从键盘键入3个整数a,b,c,输出其中...
用C++编写一个C程序,输入a,b,c,3个值,输出其中最大...
设计一个C语言程序, 从键盘上输入a,b,c三个整数,输出其...
c语言编程:从键盘上输入a,b,c三个整数,输出其中的最小者...
由键盘输入3个整数A,B,C,编写程序输出这三个数中的最小值
编写一个C程序,输入a,b,c三个值 输出其中最大者。
编写一个程序,输入a,b,c三个值,输出其中最大者?
C语言求3个数最大 怎么写如题,编写一个程序,输入a、b、c...