pesquisa

PROBLEMA URI 1013 - O Maior SOLUÇÃO EM C

URI Online Judge | 1013

O Maior

Adaptado por Neilor Tonin, URI  Brasil
Timelimit: 1
Faça um programa que leia três valores e apresente o maior dos três valores lidos seguido da mensagem “eh o maior”. Utilize a fórmula:

Entrada

O arquivo de entrada contém três valores inteiros.

Saída

Imprima o maior dos três valores seguido por um espaço e a mensagem "eh o maior".


URI Online Judge | 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”.









#include <stdio.h>

int main() {
 int A, B, C, MaiorAB;
scanf("%d %d %d", &A, &B, &C);
MaiorAB =(A+B+abs(A-B))/2;
MaiorAB=(C+MaiorAB+abs(MaiorAB-C))/2;
printf("%d eh o maior\n",MaiorAB);
    return 0;
}

Postar um comentário

0 Comentários