【C学习笔记】day2-3 求10 个整数中最大值

#include <stdio.h>
#define n 10 int main() { int max=0; int a[n] = {12,15,16,546,165,654,612,23,48,84}; for (int i = 0; i < 10; i++) { if (a[i] >= max) max = a[i]; } printf("%d", max); return 0; }

 

 

posted @ 2021-12-04 14:36  2021yer  阅读(99)  评论(0编辑  收藏  举报