1013 The Greatest

SemiColon
By -
0


URI Online Judge | 1013

The Greatest

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 SamplesOutput Samples
7 14 106106 eh o maior
217 14 6217 eh o maior


Solution:

#include <stdio.h>

int main()
{
 int a, b, c, tmp;

 scanf("%d %d %d", &a, &b, &c);

 tmp = a;
 if(a < b || a < c){
  if(b < c){
   tmp = c;
  }else{
   tmp = b;
  }
 }

 printf("%d eh o maior\n", tmp);

 return 0;
}

Tags:

Post a Comment

0Comments

Post a Comment (0)