Solução: Problema da caneta do presidenciável

From AdonaiMedrado.Pro.Br
Revision as of 19:07, 18 December 2010 by Adonaimedrado (Talk | contribs) (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 …')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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");
        }
    }
}