设计C++函数 float fun(float a[],int n,float &max,float &min),查找数组a中最大值元素max 和最小值元素

[复制链接]
查看11 | 回复1 | 2012-11-9 11:58:11 | 显示全部楼层 |阅读模式
#include"stdio.h"float fun(float a[],int n,float &max,float &min);int main(){ float max,min; float a[10]={1.0,2.0,5.0,4.0,3.0,9.0,10.000,50.5,19.0,13.0}; fun(a,10,max,min); printf("max = %f min = %f",max,min);
return 0;}float fun(float a[],int n,float &max,float &min){ max = a[0]; min = a[0]; for(i...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行