c语言 有6个实数a,b,c,d,e,f由键盘输入,编写程序输出其中最小的数

以上

#include "stdio.h"
int main(int argv,char *argc[]){
int a,b,c,d,e,f,t;
printf("Input 6 integers...\n");
scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
t=a;
if(t>b)
t=b;
if(t>c)
t=c;
if(t>d)
t=d;
if(t>e)
t=e;
if(t>f)
t=f;
printf("The smallest is %d\n",t);
return 0; 
}

运行样例:

温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-01-18
#include<stdio.h>
int main ()
{float a,b,c,d,e,f;
 scanf("%f%f%f%f%f%f",&,,&b,&c,&d,&e,&f);
 if(b<a)a=b;
 if(c<a)a=c;
 if(d<a)a=d;
 if(e<a)a=e;
 if(f<a)a=f;
 printf("%f\n",a);
 return 0;
}

相似回答