FirdavsOlimjonov / max-in-seq

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Find the maximum integer in a sequence

The purpose of this exercise is to train you to use simple loops and conditional statements.

Estimated workload of this exercise is 20 min.

Description

Please, proceed to FindMaxInSeq and write a program that reads a sequence of integer values from standard output and finds the maximum value. You must place your solution into the max method to pass tests.

Details:

  • You must read sequence values until the next one is 0. Zero value means end of the input sequence.
  • The sequence is guaranteed to contain at least one value.

Example

Input:

2 4 6 9 2 4 5 0

Output:

9

About


Languages

Language:Java 100.0%