首页 > 其他 > 详细

OJ 注意事项

时间:2014-12-26 16:26:08      阅读:229      评论:0      收藏:0      [点我收藏+]

1,检查指针是否有效,即是否为NULL

 1 void OutputMaxAndMin(int * pInputInteger, int InputNum, int * pMaxValue, int * pMaxNum, int * pMinValue, int * pMinNum)
 2 {
 3     /*在这里实现功能*/
 4         int i = 0;
 5     int num = 0;
 6     if (InputNum <= 0 || pInputInteger == NULL)
 7     {
 8         *pMaxNum =0;
 9         *pMinNum = 0;
10         *pMaxValue = 0;
11         *pMinValue = 0;
12         return;
13     }
14 
15     .....
16 }

 

OJ 注意事项

原文:http://www.cnblogs.com/wanghui390/p/4186954.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!