如何把YTIIIG A调速器上唯一的指针从MAX调到MIN

[复制链接]
查看11 | 回复1 | 2011-10-17 12:39:11 | 显示全部楼层 |阅读模式
回复

使用道具 举报

千问 | 2011-10-17 12:39:11 | 显示全部楼层
#includestdio.h#includestdlib.hintGetMaxOrMin(int*pArr,intnLen,boolbGetMaxOrMin){//获取数组中的最小值if(NULL==pArr)return-1;if(nLen1)return-1;intnRet=*(pArr);for(inti=1;inLen;i){intnTemp=*(pArr);if(bGetMaxOrMin){if(nTempnRet)nRet=nTemp;}else{if(nTempnRet)nRet=nTemp;}}returnnRet;}intmain(intargc,char*argv[]){intarrInt[10]=;for(inti=1;i=10;i){printf(\"请输入第%d个数:\",i);scanf(\"%d\",}printf(\"最大数为:%d\\n\",GetMaxOrMin(arrInt,10,true));printf(\"最小数为:%d\\n\",GetMaxOrMin(arrInt,10,false));return0;}
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行