D. 找最小值

    Type: Default 1000ms 256MiB

找最小值

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

给出 n(n≤100) 和 n 个整数 ai (0≤ai≤1000) ,求这 n 个整数中最小值是什么。 提示:我们可以使用 min() 函数来获得两个数字中的最小值 。需要使用 algorithm 头文件。

minnum = min(minnum, tmp); 
maxnum = max(maxnum, tmp);

前者 minnum 取 minnum 和 tmp 中 较小 的那个 后者 maxnum 取 maxnum 和 tmp 中 较大 的那个

样例输入

3
1 2 5

样例输出

1

龙凤苑中学B班5.14

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2024-5-14 16:15
End at
2024-5-18 16:15
Duration
96 hour(s)
Host
Partic.
23