Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /**
- *
- * @author aluno
- */
- public class Idade {
- public static void main(String[] args){
- try {
- Scanner in = new Scanner(System.in);
- Integer valor1 = in.nextInt();
- Integer maior = valor1;
- Integer valor2 = in.nextInt();
- if (valor2 > maior) {
- maior = valor2;
- }
- Integer valor3 = in.nextInt();
- if (valor3 > maior) {
- maior = valor3;
- }
- System.out.print(maior + " E A MAIOR IDADE ");
- } catch(Exception e) {
- System.out.print("Erro ao inserir valorf");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement