/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package aula1; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * * @author soro */ public class VerificCalc { /* * Ler dois números se o primeiro for maior que o segundo imprimir a * multiplicação dos dois senão chamar um terceiro número e retornar a * multiplicação dos três. */ public static void main(String[] args) { String x = ""; int multi; BufferedReader reader = new BufferedReader(new InputStreamReader( System.in)); try { System.out.println("Entre com o primeiro número"); x = reader.readLine(); int x1 = new Integer(x).intValue(); System.out.println("Entre com o segundo número"); x = reader.readLine(); int x2 = new Integer(x).intValue(); if (x1 > x2) { multi = x1 * x2; } else { System.out.println("Entre com o terceiro número"); x = reader.readLine(); int x3 = new Integer(x).intValue(); multi = x1 * x2 * x3; } System.out.println("Multiplicação: " + multi); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }