写程序:键盘输入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
相似回答