求10个数中最大值

来源:互联网 发布:linux 北京时间 编辑:程序博客网 时间:2024/05/17 23:03
#include<stdio.h>int main(){int a[10];int i,j;int max = 0;for(j = 0; j < 10; j++){scanf("%d",&a[j]);}for(i = 0;i < 10;i++){if(a[i] > max){max = a[i];}}printf("%d\n",max);return 0;}

0 0