Problem C: 数组---求数组中的最大值

来源:互联网 发布:荣耀v10网络制式 编辑:程序博客网 时间:2024/05/19 17:48

Problem C: 数组---求数组中的最大值

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 276  Solved: 160
[Submit][Status][Web Board]

Description

输入10个整数值到一个长度为10的数组中,然后求出该数组中的最大值。

Input

10个整数

Output

最大值

Sample Input

-100 98 205 88 67 -23 88 34 12 4

Sample Output

205

HINT

用数组来做

#include<stdio.h>int main(){    int a[10],i,max=-9999;    for(i=0;i<10;i++)    {       scanf("%d",&a[i]);       max=(max>a[i])?max:a[i];    }    printf("%d\n",max);    return 0;}


0 0
原创粉丝点击