ListaIncremental Z NumerosEnteros
import java.lang.*;
import java.io.*;
import java.util.*;
/**
* class PuntoEnX here.
*
* @author (Amalio)
* @version (PX_v1)
*/
public class PuntoNumEnt{
// instance variables
private static int z;
/*
* Constructor for objects of class PuntoEnX
*/
public PuntoNumEnt(){
/*initialise instance variables en el origen de coordenadas*/
this.z = 0;
}
/*
* Constructor for objects of class PuntoEnX
*/
public PuntoNumEnt(int z){
/*initialise instance variables*/
this.z = z;
}
/*
* An example of a method - replace this comment with your own
*
* @param y a sample parameter for a method
* @return the sum of x and y
*/
public static int sumaNumEnt(int y){
/* put your code here*/
int devuelve = 0;
for(devuelve=0;devuelve <=y-1; devuelve=devuelve+1)
devuelve=devuelve++;
return devuelve+1;
}
public static void main(String[]arg){
for(int z = 0;z<=49;z++){
String l ="|";
System.out.print(sumaNumEnt(z)+"|");
z= z;}
}
}
Introduzca el numero de enteros a listar: cada entero ocupa todo una casilla
8
1|2|3|4|5|6|7|8|
Comentarios
Publicar un comentario