All pastes #942508 Raw Edit

Verificador

public java v1 · immutable
·published 2008-03-14 15:48 UTC
rendered paste body
/* * 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 MultresImpar {	/*	 * Ler um número se este for par verificar se é multiplo de 3. Se este for	 * impar verificar se é maior que 9.	 */	/**	 * @param args	 */	public static void main(String[] args) {		String x = "";		BufferedReader reader = new BufferedReader(new InputStreamReader(				System.in));		try {			System.out.println("Entre com um número qualquer");			x = reader.readLine();			int x1 = new Integer(x).intValue();			if (x1 % 2 == 0) {				if (x1 % 3 == 0) {					System.out.println("É multiplo por 3");				} else {					System.out.println("Não é multiplo de 3");				}			}			if (x1 % 2 != 0) {				if (x1 > 9) {					System.out.println("É maior que 9");				} else {					System.out.println("Não é maior que 9");				}			}		} catch (IOException e) {			e.printStackTrace();		}	}}