Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /**
  4.  *
  5.  * @author aluno
  6.  */
  7. public class Idade {
  8.    
  9.     public static void main(String[] args){
  10.         try {
  11.             Scanner in = new Scanner(System.in);
  12.             Integer valor1 = in.nextInt();
  13.             Integer maior   = valor1;
  14.             Integer valor2 = in.nextInt();
  15.             if (valor2 > maior) {
  16.                 maior = valor2;
  17.             }
  18.             Integer valor3 = in.nextInt();
  19.             if (valor3 > maior) {
  20.                 maior = valor3;
  21.             }
  22.            
  23.             System.out.print(maior + " E A MAIOR IDADE ");
  24.         } catch(Exception e) {
  25.             System.out.print("Erro ao inserir valorf");
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement