URI 1013 The Greatest solution in JAVA
URI 1013 is another beginner level problem, which is solved by me, and sharing it because it might be hard to understand the problem to some beginner.
Solution :
We are going to make a program that reads 3 integer values and present the greatest one followed by the message "eh o maior". Use the following formula:
Maior AB = ( a + b + abs ( a - b )) / 2
Input
The input file contains 3 integer values.
Sample input
17 148 67
Output
Print the greatest of these three values followed by a space and the message “eh o maior”.
Sample output
148 eh o maior
Hope this will help you, and let me know if you have any better solution <3
Comments
Leave a comment
You are not LoggedIn but you can comment as an anonymous user which requires manual approval. For better experience please Login.