BlueBook

p171ex6a - Max

Given T real numbers, find and output the largest one to four decimal places.

Input

The first line contains a single integer T (1 ≤ T ≤ 1000000). Each of the following T lines contains one real number xi (-106xi ≤ 106).

Output

A single line: the largest of the T real numbers.

Sample Input

3
1.5
3
2.2

Sample Output

3.0000

All Submissions
Best Solutions


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

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

Comments (Search)

Why does my program output 0.0000

Reading comprehension is an extremely important skill in solving programming problems. It's especially important to always consider the constraints provided.

Does it have to do with the numbers being real numbers?

Which of your own test cases have you tried?

Oh, I think it's because when I tried negative numbers, it came up with 0.0000

Please use the reply function (that's the green plus icon on the right side of a comment). Well done figuring it out!

Why when I try to sort a double array this appear:"[D@42a57993" ?

are you printing the array or the elements of the array? cause if you just printed the array, it will give you the memory location of the array, so its like your example, you should print the elements of the array instead of printing the array

i just can't figure out what's wrong!!!

lol i failed.... i forgot that the intitiazation for the floats are 0.... i failed

I tried a big bunch of test cases, but they all seem to be working on ideone.

"one real number x (-10^6 ≤ x ≤ 10^6)."