Ad Code

Responsive Advertisement

Uri - Beecrowd | 1013 | The Greatest

beecrowd | 1013

The Greatest

Adapted by Neilor Tonin, URI  Brazil


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

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

N.B.: It's better if you solve this by your own. Thank you!

  URI - BEECROWD Online Judge 1013 Solve  in C :                                          

//Solved by Intesar
#include <stdio.h>

int main() {

    int a,b,c,d;
    scanf("%d%d%d",&a,&b,&c);
    d=(a+b+abs(a-b))/2;
    d=(d+c+abs(d-c))/2;
    printf("%d eh o maior\n",d);

    return 0;
}

Post a Comment

0 Comments

Ad Code

Responsive Advertisement