Difference between revisions of "Solução: Problema da caneta do presidenciável"

From AdonaiMedrado.Pro.Br
Jump to: navigation, search
(Created page with '<code lang=java> import java.util.Scanner; public class Questao2 { public static void main(String[] args) { Scanner leitor = new Scanner(System.in); int …')
(No difference)

Revision as of 19:07, 18 December 2010

import java.util.Scanner;
 
public class Questao2
{
    public static void main(String[] args)
    {
        Scanner leitor = new Scanner(System.in);
        int  b, p;
 
        b = leitor.nextInt();
 
        for(int i = 0; i < b; i++)
        {
            p = leitor.nextInt();
            if (p%2 == 0)
                System.out.println("para dentro");
            else
                System.out.println("para fora");
        }
    }
}