## p287ex3 - Min

Find the minimum in a list of real numbers.

### Input

The first line contains an integer N (1 ≤ N ≤ 10 000). Each of the following N lines contains one real number xi (-1000 < xi < 1000).

### Output

The minimum of the N real numbers given, rounded to two decimal places.

```2
10.1
12.3
```

### Sample Output

```10.10
```

Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 26, 2008

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

## Comments (Search)

• (0/0)
It's not working for me. Keeps saying error but gives no error message whatsoever.

• (0/0)
You're not printing the min?

• (1/0)
i tried my code and it easily worked on ideone. When i put it here, it gives me -0.03 and says its wrong.

• (0/0)
Do note that they are reals, not integers. This would be significant in a language like C++ or Java.

Your program handles negative numbers weirdly. I searched around a bit, and by casting input() to float, it seemed to work more correctly, though it still received RTE on ideone.

• (1/0)
So i have to change my input to a float?

even when i use the str(round()) method it still doesnt work, saying (line 8, type str does not define _round_.

wait, what do you mean by "by casting input() to float, it seemed to work"?

• (0/0)
float(input()) instead of input() made it work for me

• (1/0)
thanks!

• (0/0)
It seems you are fundamentally misunderstanding the suggestion.

1. input() returns a string.
2. float(input()) casts said string to a float (aka a double or a real).
3. int(input()) casts said string to an integer.

Since N is an integer, clearly after reading it in, you should treat it as an integer.

As for the N real numbers, well, they're reals, so you should be casting them to floats.

PS: To reply to a comment, don't just type it into the bottom. Click the + sign in the top-right corner.