C语言求出a,b,c三个数中的最大值?输出的总是最小值!错在哪?#include void main() { float a,b,c,m; scanf("%f,%f,%f",&a,&b,&c); if(a>b) m=a; else m=b; if(c>m) m=c; printf("max numble is %f\n",m); getch(); } 答案 #include void main() { float a,b,c...
float类型的最大值: 3.402823E+38,最小值: -3.402823E+38 double类型的最大值: 1.79769313486232E+308,最小值: -1.79769313486232E+308 decimal类型的最大值: 79228162514264337593543950335,最小值: -79228162514264337593543950335 下面的代码说明了double和decimal表达精度能力的不同: static void Main(string[] args) ...
include<stdio.h>int main(){int i;float a[10];float max,min;printf("please enter 10 float:\n");for(i=0;i<10;i++)scanf("%f",&a[i]);max=min=a[0];for(i=1;i<10;i++){if(a[i]>max) max=a[i];if(a[i]<min) min=a[i];}printf("max = %f\n",max);prin...
int main(){ float max,min,a[N];int n,i;scanf("%d",&n);for(i=0;i<n;i++)scanf("%f",a+i);for(max=min=a[0],i=1;i<n;i++){ if(a[i]>max)max=a[i];if(a[i]<min)min=a[i];} printf("%g %g",max,min);return 0;} //普通版本 include <stdio.h> int ...
float t,a[6][6],max,min;for(i=0; i<6; i++)for(j=0; j<6; j++)scanf("%f",&a[i][j]);max=min=a[0][0];for(i=0; i<6; i++)for(j=0; j<6; j++)if(a[i][j]>max)max=a[i][j];else if(a[i][j]<min)min=a[i][j];printf("max-min=%g\n",...
include <stdio.h>#define N 100int main(){ float max,min,a[N]; int n,i; scanf("%d",&n); for(i=0;i<n;i++) scanf("%f",a+i); for(max=min=a[0],i=1;i<n;i++) { if(a[i]>max) max=a[i]; if(a[i]<min) min=a[i];...
*max,float *min){int i;*max=*min=a[0];for(i=1;i<n;i++) if(a[i]>*max)*max=a[i]; else if(a[i]<*min)*min=a[i];}int main(){int n,i;float a,b,x[100];scanf("%d",&n);for(i=0;i<n;i++)scanf("%f",&x[i]);fmaxmin(n,x,&a,&b);...