|    
			
				23/07/2007, 23:31
			
			
			  | 
  |   |  |  |  Fecha de Ingreso: noviembre-2003 
						Mensajes: 59
					 Antigüedad: 21 años, 11 meses Puntos: 0 |  | 
  |  Re: ayuda, fucion sencilla para hacer esto  
  
Código:
  /*
 * Sencilla.java
 * 
 * Created on 24-07-2007, 01:16:35 AM
 * 
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package uno;
import java.util.Scanner;
/**
 *
 * @author Picaporte
 */
public class Sencilla {
    public Sencilla() {
    }
    public static void main(String args[]){
        Scanner in=new Scanner(System.in);
        int entrada,suma=0;
        
        System.out.println("Ingrese un numero Entero:?");
        entrada=in.nextInt();
        
        for(int i=1;i<entrada;i++){
            suma+=i;           
        }
        
        System.out.println("La suma de los antecesores es "+suma);
    }
}
Saludos.      |