Difference between revisions of "Java: Soma de dois números inteiros"

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

Revision as of 00:55, 14 August 2010

public class Somador
{
    public static void main(String[] args)
    {
        java.util.Scanner s = new java.util.Scanner(System.in);
        int acumulador=0;
        for(int x=0;x<10;x++)
            acumulador+=s.nextInt();
 
        System.out.println(acumulador);
    }
}