/ 科创班 /

记录详情

Accepted


  
# 状态 耗时 内存占用
#1 Accepted 2ms 256.0 KiB
#2 Accepted 2ms 256.0 KiB
#3 Accepted 2ms 256.0 KiB
#4 Accepted 2ms 256.0 KiB
#5 Accepted 2ms 256.0 KiB
#6 Accepted 3ms 256.0 KiB
#7 Accepted 5ms 256.0 KiB
#8 Accepted 4ms 348.0 KiB
#9 Accepted 3ms 256.0 KiB

代码

#include <stdio.h>

int main()
{
    int i, n, a[10000];
    int sum, the_min, the_max;
    scanf("%d", &n);
    for (i = 0; i < n; i++)
        scanf("%d", &a[i]);
    sum = the_min = the_max = a[0];
    for (i = 1; i < n; i++)
    {
        sum += a[i];
        if (the_min > a[i]) the_min = a[i];
        if (the_max < a[i]) the_max = a[i];
    }
    printf("%d\n%d\n%d", the_max, the_min, sum);
    return 0;
}

信息

递交者
类型
递交
题目
数列特征
题目数据
下载
语言
C
递交时间
2018-10-17 20:13:03
评测时间
2018-10-17 20:13:03
评测机
分数
100
总耗时
29ms
峰值内存
348.0 KiB