Java: Soma de dois números inteiros

From AdonaiMedrado.Pro.Br
Revision as of 00:53, 14 August 2010 by Adonaimedrado (Talk | contribs) (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;…')

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