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 = ...

有多急?!

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

我手动给你敲。。 #include int a[11]; int main() { int i,n=10,mx,mi; for(i=0;i

#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; }

#include void main(){int i,max,min,n;scanf("%d",&n);max=n;min=n;for(i=1;i

#include void main() { int a[10]; int sum = 0; int max = 0, min = 0; printf("输入10个数:"); for(int i = 0; i < 10; ++i) { scanf("%d",&a[i]); sum += a[i]; if(max = a[i]) min = a[i]; } printf("%d]t",max); printf("%d]t",min); getc...

#include void main() { int a,b,c; scanf("%d%d%d",&a,&b,&c);//从键盘上输入a,b,c三个整数 if(a

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