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 …')
 
 
Line 2: Line 2:
 
import java.util.Scanner;
 
import java.util.Scanner;
  
public class Questao2
+
public class Caneta
 
{
 
{
 
     public static void main(String[] args)
 
     public static void main(String[] args)

Latest revision as of 19:09, 18 December 2010

import java.util.Scanner;
 
public class Caneta
{
    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");
        }
    }
}