您的位置:首页 > 编程语言 > C语言/C++

C语言编写循环,判断十个整数中的最大值

2018-02-05 00:14 323 查看
#include<stdio.h>
#include<stdlib.h>
int main()
{
int arr[10] = {1,2,3,4,5,6,7,8,9,10};
int n = 0;
int max = arr[0];
for(n = 0;n < 10; n++)
{
if(arr
> max)
{
max = arr
;
}

}
printf("%d\n",max);
system("pause");
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c语言
相关文章推荐