码迷,mamicode.com
首页 > 编程语言 > 详细

求数组中元素的最大值

时间:2017-02-20 11:40:42      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:clu   数组   class   int   style   logs   std   log   code   

#include <stdio.h>
int main(void)
{
    int a[10] = {20,123,4543,556,34,5,54,43,234,53};
    
    int max = a[0];
    int i;
    for(i=1;i<10;i++){
       if(max<a[i]){
          max = a[i];
       }
    }
    printf("max=%d\n",max);    
    return 0;
}

 

求数组中元素的最大值

标签:clu   数组   class   int   style   logs   std   log   code   

原文地址:http://www.cnblogs.com/dafume/p/6418328.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!