tmrd.net
当前位置:首页>>关于设计一C语言程序,从5个数中取最大数和最小数?的资料>>

设计一C语言程序,从5个数中取最大数和最小数?

#include void main() { int num[5],max,min,i; //其中max是最大值的变量,min是最小值的变量 printf("请输入5个数:\n"); for(i=0;i

#include int main( ) { bool in = true; int i, a, maxn, minn; for ( i = 0; i < 5; i++ ) { scanf("%d", &a); if ( in ) { maxn = minn = a; in = false; } if ( maxn < a ) maxn = a; if ( minn > a ) minn = a; } printf("Max = %d\nMin = ...

#include int main( ) { bool in = true; int i, a, maxn, minn; for ( i = 0; i < 5; i++ ) { scanf("%d", &a); if ( in ) { maxn = minn = a; in = false; } if ( maxn < a ) maxn = a; if ( minn > a ) minn = a; } printf("Max = %d\nMin = ...

有多急?!

#include int main(){ int a,b,c,min,max; printf("请输入三个数,用空格键隔开"); scanf("%d%d%d",&a,&b,&c); min=ac?b:c); printf("min+max=%d",min+max); return 0; }

//满意请采纳#includeint main(){int a[5]={0},i,max,min;for(i=0;i

//满意请采纳#includeint main(){int a[5]={0},i,max,min;for(i=0;i

//#include "stdafx.h"//If the vc++6.0, with this line.#include "stdio.h"double average(double a[]){ int i; double max,min; for(max=min=a[0],i=1;imax) max=a[i]; if(a[i]

MATLAB版本: A = [ 4 6 3 2; 1 5 8 9; 0 4 10 6 ]; max(max(A)) %Maximum value of A min(min(A)) %Minimum value of A

网站首页 | 网站地图
All rights reserved Powered by www.tmrd.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com