E. Minimum

Problem Setup

  • login to CS50 IDE
  • write cd in the terminal to go to the home directory
  • write mkdir minimum to create a folder called minimum
  • write cd minimum to go to the minimum folder
  • write code minimum.cpp to create a file called minimum.cpp and open it in the editor

Problem

Given an array of \(n\) integers, find the minimum element in the array.

Input

First line: \(n\) where \(1 \leq n \leq 100\), the number of elements in the array.

Second line: \(n\) integers \(a_1, a_2, \ldots, a_n\) where \(-10^4 \leq a_i \leq 10^4\), the elements of the array.

Output

Print the minimum element in the array.

Examples

Example 1:

Input:

5
3 -1 5 -13 -10

Output:

-13

Example 2:

Input:

4
2 4 6 8

Output:

2

Test Your Code

Make sure you are in the minimum directory, then run the following command:

check50 iti-technical-team/week3/2026/3/minimum

Submit Your Code

Make sure you are in the minimum directory, then run the following command:

submit50 iti-technical-team/week3/2026/3/minimum