## Algorithm

Problem Name: beecrowd | 1013

# The Greatest

Adapted by Neilor Tonin, URI Brazil

Timelimit: 1

Make a program that reads 3 integer values and present the greatest one followed by the message "eh o maior". Use the following formula:

## Input

The input file contains 3 integer values.

## Output

Print the greatest of these three values followed by a space and the message “eh o maior”.

 Input Samples Output Samples 7 14 106 106 eh o maior

 217 14 6 217 eh o maior

## Code Examples

### #1 Code Example with C Programming

```Code - C Programming```

``````
#include<stdio.h>
int main()
{
int a,b,c,major,MaiorAB;
scanf("%d %d %d" ,&a ,&b ,&c);
MaiorAB = (a+b+abs(a-b))/2;
major = (MaiorAB+c+abs(MaiorAB-c))/2;
printf("%d eh o maior",major);
printf("\n");

return 0;
}
``````
Copy The Code &

Input

cmd
7 14 106

Output

cmd
106 eh o maior

### #2 Code Example with C++ Programming

```Code - C++ Programming```

``````
#include <iostream>

using namespace std;

int main() {
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
if (a >= b && a >= c)
printf("%d eh o maior\n", a);
else if (b >= a && b >= c)
printf("%d eh o maior\n", b);
else
printf("%d eh o maior\n", c);
return 0;
}
``````
Copy The Code &

Input

cmd
7 14 106

Output

cmd
106 eh o maior

### #3 Code Example with Javascript Programming

```Code - Javascript Programming```

``````
let linhas = input.split('\n');

let result = parseInt((a + b + Math.abs(a - b)) / 2);
let maior = parseInt((result + c + Math.abs(result - c)) / 2);
console.log(maior, "eh o maior");
``````
Copy The Code &

Input

cmd
217 14 6

Output

cmd
217 eh o maior

### #4 Code Example with Python Programming

```Code - Python Programming```

``````
a, b, c = input().split(" ")
maior = (int(a) + int(b) + abs(int(a) - int(b))) / 2
resultado = (int(maior) + int(c) + abs(int(maior) - int(c))) / 2
``````
Copy The Code &

Input

cmd
217 14 6

Output

cmd
217 eh o maior